using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
namespace Emby.Server.Implementations.Channels
{
///
/// A media source provider for channels.
///
public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
{
private readonly ChannelManager _channelManager;
///
/// Initializes a new instance of the class.
///
/// The channel manager.
public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
{
_channelManager = (ChannelManager)channelManager;
}
///
public Task> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
{
return item.SourceType == SourceType.Channel
? _channelManager.GetDynamicMediaSources(item, cancellationToken)
: Task.FromResult(Enumerable.Empty());
}
///
public Task OpenMediaSource(string openToken, List currentLiveStreams, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
}
}