コード例 #1
0
 private async Task <IEnumerable <MediaSourceInfo> > GetDynamicMediaSources(IHasMediaSources item, IMediaSourceProvider provider, CancellationToken cancellationToken)
 {
     try
     {
         return(await provider.GetMediaSources(item, cancellationToken).ConfigureAwait(false));
     }
     catch (Exception ex)
     {
         _logger.ErrorException("Error getting media sources", ex);
         return(new List <MediaSourceInfo>());
     }
 }
コード例 #2
0
        private async Task <IEnumerable <MediaSourceInfo> > GetDynamicMediaSources(IHasMediaSources item, IMediaSourceProvider provider, CancellationToken cancellationToken)
        {
            try
            {
                var sources = await provider.GetMediaSources(item, cancellationToken).ConfigureAwait(false);

                var list = sources.ToList();

                foreach (var mediaSource in list)
                {
                    SetKeyProperties(provider, mediaSource);
                }

                return(list);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting media sources", ex);
                return(new List <MediaSourceInfo>());
            }
        }
コード例 #3
0
ファイル: MediaSourceManager.cs プロジェクト: biltongza/veso
        private async Task<IEnumerable<MediaSourceInfo>> GetDynamicMediaSources(BaseItem item, IMediaSourceProvider provider, CancellationToken cancellationToken)
        {
            try
            {
                var sources = await provider.GetMediaSources(item, cancellationToken).ConfigureAwait(false);
                var list = sources.ToList();

                foreach (var mediaSource in list)
                {
                    mediaSource.InferTotalBitrate();

                    SetKeyProperties(provider, mediaSource);
                }

                return list;
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error getting media sources");
                return new List<MediaSourceInfo>();
            }
        }
コード例 #4
0
ファイル: MediaSourceManager.cs プロジェクト: t-andre/Emby
        private async Task<IEnumerable<MediaSourceInfo>> GetDynamicMediaSources(IHasMediaSources item, IMediaSourceProvider provider, CancellationToken cancellationToken)
        {
            try
            {
                var sources = await provider.GetMediaSources(item, cancellationToken).ConfigureAwait(false);
                var list = sources.ToList();

                foreach (var mediaSource in list)
                {
                    SetKeyProperties(provider, mediaSource);
                }

                return list;
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting media sources", ex);
                return new List<MediaSourceInfo>();
            }
        }