Clean up and document ChannelDynamicMediaSourceProvider.cs

This commit is contained in:
Patrick Barron 2020-04-14 15:28:02 -04:00
parent 4c0547f90c
commit 543c76a8f1

View File

@ -1,5 +1,3 @@
#pragma warning disable CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
@ -11,6 +9,9 @@ using MediaBrowser.Model.Dto;
namespace Emby.Server.Implementations.Channels namespace Emby.Server.Implementations.Channels
{ {
/// <summary>
/// A media source provider for channels.
/// </summary>
public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
{ {
private readonly ChannelManager _channelManager; private readonly ChannelManager _channelManager;
@ -27,12 +28,9 @@ namespace Emby.Server.Implementations.Channels
/// <inheritdoc /> /// <inheritdoc />
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken) public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
{ {
if (item.SourceType == SourceType.Channel) return item.SourceType == SourceType.Channel
{ ? _channelManager.GetDynamicMediaSources(item, cancellationToken)
return _channelManager.GetDynamicMediaSources(item, cancellationToken); : Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
}
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
} }
/// <inheritdoc /> /// <inheritdoc />