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>()); } }
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>()); } }
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>(); } }
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>(); } }