2013-12-22 19:58:51 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-12-15 02:17:57 +01:00
|
|
|
|
using MediaBrowser.Model.LiveTv;
|
2013-11-25 21:39:23 +01:00
|
|
|
|
using MediaBrowser.Model.Querying;
|
2013-09-26 17:48:14 +02:00
|
|
|
|
using System.Collections.Generic;
|
2013-11-27 03:38:11 +01:00
|
|
|
|
using System.Threading;
|
2013-11-26 22:36:11 +01:00
|
|
|
|
using System.Threading.Tasks;
|
2013-09-26 17:48:14 +02:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.LiveTv
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Manages all live tv services installed on the server
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ILiveTvManager
|
|
|
|
|
{
|
2013-12-04 21:55:42 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the active service.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The active service.</value>
|
|
|
|
|
ILiveTvService ActiveService { get; }
|
|
|
|
|
|
2013-09-26 17:48:14 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the services.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The services.</value>
|
|
|
|
|
IReadOnlyList<ILiveTvService> Services { get; }
|
|
|
|
|
|
2013-12-17 21:02:12 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the new timer defaults asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{TimerInfo}.</returns>
|
2013-12-18 06:44:46 +01: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 21:02:12 +01:00
|
|
|
|
|
2013-11-29 17:58:24 +01: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 21:55:42 +01:00
|
|
|
|
|
2013-12-15 15:19:24 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cancels the series timer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CancelSeriesTimer(string id);
|
|
|
|
|
|
2013-09-26 17:48:14 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the parts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="services">The services.</param>
|
|
|
|
|
void AddParts(IEnumerable<ILiveTvService> services);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// Gets the channels.
|
2013-09-26 17:48:14 +02:00
|
|
|
|
/// </summary>
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// <param name="query">The query.</param>
|
2013-12-15 02:17:57 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// <returns>IEnumerable{Channel}.</returns>
|
2013-12-15 02:17:57 +01:00
|
|
|
|
Task<QueryResult<ChannelInfoDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken);
|
2013-11-24 21:51:45 +01:00
|
|
|
|
|
2013-12-04 05:18:50 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recording.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
2013-12-15 02:17:57 +01:00
|
|
|
|
/// <param name="user">The user.</param>
|
2013-12-04 05:18:50 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{RecordingInfoDto}.</returns>
|
2013-12-15 02:17:57 +01:00
|
|
|
|
Task<RecordingInfoDto> GetRecording(string id, CancellationToken cancellationToken, User user = null);
|
2013-12-04 05:18:50 +01:00
|
|
|
|
|
2013-12-15 02:17:57 +01: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);
|
|
|
|
|
|
2013-12-04 05:18:50 +01:00
|
|
|
|
/// <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 02:17:57 +01: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);
|
|
|
|
|
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// <summary>
|
2013-11-26 03:53:48 +01:00
|
|
|
|
/// Gets the recordings.
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// </summary>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-11-26 03:53:48 +01:00
|
|
|
|
/// <returns>QueryResult{RecordingInfoDto}.</returns>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, CancellationToken cancellationToken);
|
2013-11-24 21:51:45 +01:00
|
|
|
|
|
2013-11-27 20:04:19 +01: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 21:55:42 +01:00
|
|
|
|
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// <summary>
|
2013-12-15 02:17:57 +01:00
|
|
|
|
/// Gets the series timers.
|
2013-11-24 21:51:45 +01:00
|
|
|
|
/// </summary>
|
2013-12-15 02:17:57 +01: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 03:53:48 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>Channel.</returns>
|
2013-12-19 22:51:32 +01:00
|
|
|
|
LiveTvChannel GetInternalChannel(string id);
|
2013-11-26 03:53:48 +01:00
|
|
|
|
|
2013-12-22 18:16:24 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the internal program.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>LiveTvProgram.</returns>
|
|
|
|
|
LiveTvProgram GetInternalProgram(string id);
|
|
|
|
|
|
2013-12-19 22:51:32 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recording.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>LiveTvRecording.</returns>
|
2014-01-01 19:26:31 +01:00
|
|
|
|
Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken);
|
2013-12-22 19:58:51 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recording stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
|
Task<StreamResponseInfo> GetRecordingStream(string id, CancellationToken cancellationToken);
|
2013-12-29 19:53:56 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{StreamResponseInfo}.</returns>
|
|
|
|
|
Task<StreamResponseInfo> GetChannelStream(string id, CancellationToken cancellationToken);
|
2013-12-19 22:51:32 +01:00
|
|
|
|
|
2013-12-17 21:02:12 +01: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 17:15:31 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the programs.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-11-25 17:15:31 +01:00
|
|
|
|
/// <returns>IEnumerable{ProgramInfo}.</returns>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
Task<QueryResult<ProgramInfoDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken);
|
2013-12-15 02:17:57 +01: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 21:02:12 +01: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 22:37:01 +01: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);
|
2013-09-26 17:48:14 +02:00
|
|
|
|
}
|
|
|
|
|
}
|