jellyfin-server/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs

326 lines
14 KiB
C#
Raw Normal View History

2014-10-15 04:11:40 +00:00
using MediaBrowser.Controller.Channels;
2015-04-12 18:58:21 +00:00
using MediaBrowser.Controller.Dto;
2014-10-15 04:11:40 +00:00
using MediaBrowser.Controller.Entities;
2014-06-07 19:46:24 +00:00
using MediaBrowser.Model.Dto;
2013-12-15 01:17:57 +00:00
using MediaBrowser.Model.LiveTv;
2013-11-25 20:39:23 +00:00
using MediaBrowser.Model.Querying;
using System.Collections.Generic;
using System.Threading;
2013-11-26 21:36:11 +00:00
using System.Threading.Tasks;
namespace MediaBrowser.Controller.LiveTv
{
/// <summary>
/// Manages all live tv services installed on the server
/// </summary>
public interface ILiveTvManager
{
/// <summary>
/// Gets the services.
/// </summary>
/// <value>The services.</value>
IReadOnlyList<ILiveTvService> Services { get; }
2013-12-17 20:02:12 +00:00
/// <summary>
/// Gets the new timer defaults asynchronous.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{TimerInfo}.</returns>
2013-12-18 05:44:46 +00:00
Task<SeriesTimerInfoDto> GetNewTimerDefaults(CancellationToken cancellationToken);
/// <summary>
/// Gets the new timer defaults.
/// </summary>
/// <param name="programId">The program identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{SeriesTimerInfoDto}.</returns>
Task<SeriesTimerInfoDto> GetNewTimerDefaults(string programId, CancellationToken cancellationToken);
2013-12-17 20:02:12 +00:00
/// <summary>
/// Deletes the recording.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task DeleteRecording(string id);
/// <summary>
/// Cancels the timer.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelTimer(string id);
2013-12-04 20:55:42 +00:00
2013-12-15 14:19:24 +00:00
/// <summary>
/// Cancels the series timer.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelSeriesTimer(string id);
/// <summary>
/// Adds the parts.
/// </summary>
/// <param name="services">The services.</param>
void AddParts(IEnumerable<ILiveTvService> services);
/// <summary>
2013-11-24 20:51:45 +00:00
/// Gets the channels.
/// </summary>
2013-11-24 20:51:45 +00:00
/// <param name="query">The query.</param>
2013-12-15 01:17:57 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2013-11-24 20:51:45 +00:00
/// <returns>IEnumerable{Channel}.</returns>
2014-05-31 15:13:07 +00:00
Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken);
2013-11-24 20:51:45 +00:00
/// <summary>
/// Gets the recording.
/// </summary>
/// <param name="id">The identifier.</param>
2015-04-12 18:58:21 +00:00
/// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
2015-04-12 18:58:21 +00:00
/// <param name="user">The user.</param>
/// <returns>Task{RecordingInfoDto}.</returns>
2015-04-12 18:58:21 +00:00
Task<RecordingInfoDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null);
2013-12-15 01:17:57 +00:00
/// <summary>
/// Gets the channel.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="user">The user.</param>
/// <returns>Task{RecordingInfoDto}.</returns>
Task<ChannelInfoDto> GetChannel(string id, CancellationToken cancellationToken, User user = null);
/// <summary>
/// Gets the timer.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{TimerInfoDto}.</returns>
Task<TimerInfoDto> GetTimer(string id, CancellationToken cancellationToken);
2013-12-15 01:17:57 +00:00
/// <summary>
/// Gets the series timer.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{TimerInfoDto}.</returns>
Task<SeriesTimerInfoDto> GetSeriesTimer(string id, CancellationToken cancellationToken);
2015-04-12 18:58:21 +00:00
2013-11-24 20:51:45 +00:00
/// <summary>
2013-11-26 02:53:48 +00:00
/// Gets the recordings.
2013-11-24 20:51:45 +00:00
/// </summary>
2013-11-26 21:36:11 +00:00
/// <param name="query">The query.</param>
2015-04-12 18:58:21 +00:00
/// <param name="options">The options.</param>
2013-11-26 21:36:11 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2013-11-26 02:53:48 +00:00
/// <returns>QueryResult{RecordingInfoDto}.</returns>
2015-04-12 18:58:21 +00:00
Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken);
2013-11-24 20:51:45 +00:00
2013-11-27 19:04:19 +00:00
/// <summary>
/// Gets the timers.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{TimerInfoDto}}.</returns>
Task<QueryResult<TimerInfoDto>> GetTimers(TimerQuery query, CancellationToken cancellationToken);
2013-12-04 20:55:42 +00:00
2013-11-24 20:51:45 +00:00
/// <summary>
2013-12-15 01:17:57 +00:00
/// Gets the series timers.
2013-11-24 20:51:45 +00:00
/// </summary>
2013-12-15 01:17:57 +00:00
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{SeriesTimerInfoDto}}.</returns>
Task<QueryResult<SeriesTimerInfoDto>> GetSeriesTimers(SeriesTimerQuery query, CancellationToken cancellationToken);
2013-11-26 02:53:48 +00:00
/// <summary>
/// Gets the channel.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Channel.</returns>
2013-12-19 21:51:32 +00:00
LiveTvChannel GetInternalChannel(string id);
2013-12-22 17:16:24 +00:00
2013-12-19 21:51:32 +00:00
/// <summary>
/// Gets the recording.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>LiveTvRecording.</returns>
Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken);
2013-12-22 18:58:51 +00:00
/// <summary>
/// Gets the recording stream.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
2015-03-20 05:40:51 +00:00
Task<MediaSourceInfo> GetRecordingStream(string id, CancellationToken cancellationToken);
2013-12-29 18:53:56 +00:00
/// <summary>
/// Gets the channel stream.
/// </summary>
/// <param name="id">The identifier.</param>
2015-05-16 02:36:47 +00:00
/// <param name="mediaSourceId">The media source identifier.</param>
2013-12-29 18:53:56 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{StreamResponseInfo}.</returns>
2015-05-16 02:36:47 +00:00
Task<MediaSourceInfo> GetChannelStream(string id, string mediaSourceId, CancellationToken cancellationToken);
2013-12-19 21:51:32 +00:00
2013-12-17 20:02:12 +00:00
/// <summary>
/// Gets the program.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="user">The user.</param>
/// <returns>Task{ProgramInfoDto}.</returns>
Task<ProgramInfoDto> GetProgram(string id, CancellationToken cancellationToken, User user = null);
2013-11-25 16:15:31 +00:00
/// <summary>
/// Gets the programs.
/// </summary>
/// <param name="query">The query.</param>
2013-11-26 21:36:11 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2013-11-25 16:15:31 +00:00
/// <returns>IEnumerable{ProgramInfo}.</returns>
2013-11-26 21:36:11 +00:00
Task<QueryResult<ProgramInfoDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken);
2013-12-15 01:17:57 +00:00
/// <summary>
/// Updates the timer.
/// </summary>
/// <param name="timer">The timer.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken);
/// <summary>
/// Updates the timer.
/// </summary>
/// <param name="timer">The timer.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UpdateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken);
2013-12-17 20:02:12 +00:00
/// <summary>
/// Creates the timer.
/// </summary>
/// <param name="timer">The timer.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task CreateTimer(TimerInfoDto timer, CancellationToken cancellationToken);
/// <summary>
/// Creates the series timer.
/// </summary>
/// <param name="timer">The timer.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task CreateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken);
2013-12-28 21:37:01 +00:00
/// <summary>
/// Gets the recording groups.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{RecordingGroupDto}}.</returns>
Task<QueryResult<RecordingGroupDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken);
2014-01-05 06:50:48 +00:00
/// <summary>
/// Closes the live stream.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task CloseLiveStream(string id, CancellationToken cancellationToken);
/// <summary>
/// Gets the guide information.
/// </summary>
/// <returns>GuideInfo.</returns>
GuideInfo GetGuideInfo();
2014-01-12 15:58:47 +00:00
/// <summary>
/// Gets the recommended programs.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{ProgramInfoDto}}.</returns>
Task<QueryResult<ProgramInfoDto>> GetRecommendedPrograms(RecommendedProgramQuery query,
CancellationToken cancellationToken);
2014-01-23 22:15:15 +00:00
/// <summary>
/// Gets the recommended programs internal.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;QueryResult&lt;LiveTvProgram&gt;&gt;.</returns>
Task<QueryResult<LiveTvProgram>> GetRecommendedProgramsInternal(RecommendedProgramQuery query,
CancellationToken cancellationToken);
2014-01-23 22:15:15 +00:00
/// <summary>
/// Gets the live tv information.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{LiveTvInfo}.</returns>
Task<LiveTvInfo> GetLiveTvInfo(CancellationToken cancellationToken);
/// <summary>
/// Resets the tuner.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task ResetTuner(string id, CancellationToken cancellationToken);
2014-06-07 19:46:24 +00:00
/// <summary>
/// Gets the live tv folder.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>BaseItemDto.</returns>
Task<Folder> GetInternalLiveTvFolder(string userId, CancellationToken cancellationToken);
/// <summary>
/// Gets the live tv folder.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>BaseItemDto.</returns>
Task<BaseItemDto> GetLiveTvFolder(string userId, CancellationToken cancellationToken);
2014-06-10 17:36:06 +00:00
/// <summary>
/// Gets the enabled users.
/// </summary>
/// <returns>IEnumerable{User}.</returns>
IEnumerable<User> GetEnabledUsers();
2014-08-14 13:24:30 +00:00
/// <summary>
/// Gets the internal channels.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;QueryResult&lt;LiveTvChannel&gt;&gt;.</returns>
Task<QueryResult<LiveTvChannel>> GetInternalChannels(LiveTvChannelQuery query,
CancellationToken cancellationToken);
/// <summary>
/// Gets the internal recordings.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;QueryResult&lt;BaseItem&gt;&gt;.</returns>
Task<QueryResult<BaseItem>> GetInternalRecordings(RecordingQuery query, CancellationToken cancellationToken);
2015-03-29 04:56:39 +00:00
/// <summary>
/// Gets the recording media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;IEnumerable&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<IEnumerable<MediaSourceInfo>> GetRecordingMediaSources(string id, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;IEnumerable&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<IEnumerable<MediaSourceInfo>> GetChannelMediaSources(string id, CancellationToken cancellationToken);
}
}