using System;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Querying;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.LiveTv
{
///
/// Manages all live tv services installed on the server
///
public interface ILiveTvManager
{
///
/// Gets the services.
///
/// The services.
IReadOnlyList Services { get; }
///
/// Gets the new timer defaults asynchronous.
///
/// The cancellation token.
/// Task{TimerInfo}.
Task GetNewTimerDefaults(CancellationToken cancellationToken);
///
/// Gets the new timer defaults.
///
/// The program identifier.
/// The cancellation token.
/// Task{SeriesTimerInfoDto}.
Task GetNewTimerDefaults(string programId, CancellationToken cancellationToken);
///
/// Deletes the recording.
///
/// The identifier.
/// Task.
Task DeleteRecording(string id);
///
/// Deletes the recording.
///
/// The recording.
/// Task.
Task DeleteRecording(ILiveTvRecording recording);
///
/// Cancels the timer.
///
/// The identifier.
/// Task.
Task CancelTimer(string id);
///
/// Cancels the series timer.
///
/// The identifier.
/// Task.
Task CancelSeriesTimer(string id);
///
/// Adds the parts.
///
/// The services.
/// The tuner hosts.
/// The listing providers.
void AddParts(IEnumerable services, IEnumerable tunerHosts, IEnumerable listingProviders);
///
/// Gets the channels.
///
/// The query.
/// The options.
/// The cancellation token.
/// IEnumerable{Channel}.
Task> GetChannels(LiveTvChannelQuery query, DtoOptions options, CancellationToken cancellationToken);
///
/// Gets the recording.
///
/// The identifier.
/// The options.
/// The cancellation token.
/// The user.
/// Task{RecordingInfoDto}.
Task GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null);
///
/// Gets the channel.
///
/// The identifier.
/// The cancellation token.
/// The user.
/// Task{RecordingInfoDto}.
Task GetChannel(string id, CancellationToken cancellationToken, User user = null);
///
/// Gets the timer.
///
/// The identifier.
/// The cancellation token.
/// Task{TimerInfoDto}.
Task GetTimer(string id, CancellationToken cancellationToken);
///
/// Gets the series timer.
///
/// The identifier.
/// The cancellation token.
/// Task{TimerInfoDto}.
Task GetSeriesTimer(string id, CancellationToken cancellationToken);
///
/// Gets the recordings.
///
/// The query.
/// The options.
/// The cancellation token.
/// QueryResult{RecordingInfoDto}.
Task> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken);
///
/// Gets the timers.
///
/// The query.
/// The cancellation token.
/// Task{QueryResult{TimerInfoDto}}.
Task> GetTimers(TimerQuery query, CancellationToken cancellationToken);
///
/// Gets the series timers.
///
/// The query.
/// The cancellation token.
/// Task{QueryResult{SeriesTimerInfoDto}}.
Task> GetSeriesTimers(SeriesTimerQuery query, CancellationToken cancellationToken);
///
/// Gets the channel.
///
/// The identifier.
/// Channel.
LiveTvChannel GetInternalChannel(string id);
///
/// Gets the recording.
///
/// The identifier.
/// The cancellation token.
/// LiveTvRecording.
Task GetInternalRecording(string id, CancellationToken cancellationToken);
///
/// Gets the recording stream.
///
/// The identifier.
/// The cancellation token.
/// Task{Stream}.
Task GetRecordingStream(string id, CancellationToken cancellationToken);
///
/// Gets the channel stream.
///
/// The identifier.
/// The media source identifier.
/// The cancellation token.
/// Task{StreamResponseInfo}.
Task GetChannelStream(string id, string mediaSourceId, CancellationToken cancellationToken);
///
/// Gets the program.
///
/// The identifier.
/// The cancellation token.
/// The user.
/// Task{ProgramInfoDto}.
Task GetProgram(string id, CancellationToken cancellationToken, User user = null);
///
/// Gets the programs.
///
/// The query.
/// The options.
/// The cancellation token.
/// IEnumerable{ProgramInfo}.
Task> GetPrograms(ProgramQuery query, DtoOptions options, CancellationToken cancellationToken);
///
/// Updates the timer.
///
/// The timer.
/// The cancellation token.
/// Task.
Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken);
///
/// Updates the timer.
///
/// The timer.
/// The cancellation token.
/// Task.
Task UpdateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken);
///
/// Creates the timer.
///
/// The timer.
/// The cancellation token.
/// Task.
Task CreateTimer(TimerInfoDto timer, CancellationToken cancellationToken);
///
/// Creates the series timer.
///
/// The timer.
/// The cancellation token.
/// Task.
Task CreateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken);
///
/// Gets the recording groups.
///
/// The query.
/// The cancellation token.
/// Task{QueryResult{RecordingGroupDto}}.
Task> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken);
///
/// Closes the live stream.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task CloseLiveStream(string id, CancellationToken cancellationToken);
///
/// Gets the guide information.
///
/// GuideInfo.
GuideInfo GetGuideInfo();
///
/// Gets the recommended programs.
///
/// The query.
/// The options.
/// The cancellation token.
/// Task{QueryResult{ProgramInfoDto}}.
Task> GetRecommendedPrograms(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken);
///
/// Gets the recommended programs internal.
///
/// The query.
/// The cancellation token.
/// Task<QueryResult<LiveTvProgram>>.
Task> GetRecommendedProgramsInternal(RecommendedProgramQuery query, CancellationToken cancellationToken);
///
/// Gets the live tv information.
///
/// The cancellation token.
/// Task{LiveTvInfo}.
Task GetLiveTvInfo(CancellationToken cancellationToken);
///
/// Resets the tuner.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task ResetTuner(string id, CancellationToken cancellationToken);
///
/// Gets the live tv folder.
///
/// The cancellation token.
/// BaseItemDto.
Task GetInternalLiveTvFolder(CancellationToken cancellationToken);
///
/// Gets the live tv folder.
///
/// The user identifier.
/// The cancellation token.
/// BaseItemDto.
Task GetLiveTvFolder(string userId, CancellationToken cancellationToken);
///
/// Gets the enabled users.
///
/// IEnumerable{User}.
IEnumerable GetEnabledUsers();
///
/// Gets the internal channels.
///
/// The query.
/// The cancellation token.
/// Task<QueryResult<LiveTvChannel>>.
Task> GetInternalChannels(LiveTvChannelQuery query,
CancellationToken cancellationToken);
///
/// Gets the internal recordings.
///
/// The query.
/// The cancellation token.
/// Task<QueryResult<BaseItem>>.
Task> GetInternalRecordings(RecordingQuery query, CancellationToken cancellationToken);
///
/// Gets the recording media sources.
///
/// The identifier.
/// The cancellation token.
/// Task<IEnumerable<MediaSourceInfo>>.
Task> GetRecordingMediaSources(string id, CancellationToken cancellationToken);
///
/// Gets the channel media sources.
///
/// The identifier.
/// The cancellation token.
/// Task<IEnumerable<MediaSourceInfo>>.
Task> GetChannelMediaSources(string id, CancellationToken cancellationToken);
///
/// Adds the information to recording dto.
///
/// The item.
/// The dto.
/// The user.
void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null);
///
/// Adds the information to program dto.
///
/// The programs.
/// The fields.
/// The user.
/// Task.
Task AddInfoToProgramDto(List> programs, List fields, User user = null);
///
/// Saves the tuner host.
///
/// The information.
/// Task.
Task SaveTunerHost(TunerHostInfo info);
///
/// Saves the listing provider.
///
/// The information.
/// if set to true [validate login].
/// if set to true [validate listings].
/// Task.
Task SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings);
///
/// Gets the lineups.
///
/// Type of the provider.
/// The provider identifier.
/// The country.
/// The location.
/// Task<List<NameIdPair>>.
Task> GetLineups(string providerType, string providerId, string country, string location);
///
/// Gets the registration information.
///
/// The channel identifier.
/// The program identifier.
/// The feature.
/// Task<MBRegistrationRecord>.
Task GetRegistrationInfo(string channelId, string programId, string feature);
///
/// Adds the channel information.
///
/// The dto.
/// The channel.
/// The options.
/// The user.
void AddChannelInfo(BaseItemDto dto, LiveTvChannel channel, DtoOptions options, User user);
}
}