2021-05-06 18:39:20 -04:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 15:56:24 -04:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 15:01:16 -05:00
|
|
|
using System;
|
2019-01-13 14:25:32 -05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2020-05-20 13:07:53 -04:00
|
|
|
using Jellyfin.Data.Entities;
|
2020-08-13 20:48:28 -04:00
|
|
|
using Jellyfin.Data.Events;
|
2018-12-27 18:27:57 -05:00
|
|
|
using MediaBrowser.Controller.Dto;
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Model.Dto;
|
|
|
|
using MediaBrowser.Model.LiveTv;
|
|
|
|
using MediaBrowser.Model.Querying;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.LiveTv
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 18:37:52 -04:00
|
|
|
/// Manages all live tv services installed on the server.
|
2018-12-27 18:27:57 -05:00
|
|
|
/// </summary>
|
|
|
|
public interface ILiveTvManager
|
|
|
|
{
|
2021-08-04 00:08:15 -04:00
|
|
|
event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCancelled;
|
|
|
|
|
|
|
|
event EventHandler<GenericEventArgs<TimerEventInfo>> TimerCancelled;
|
|
|
|
|
|
|
|
event EventHandler<GenericEventArgs<TimerEventInfo>> TimerCreated;
|
|
|
|
|
|
|
|
event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCreated;
|
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the services.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The services.</value>
|
|
|
|
IReadOnlyList<ILiveTvService> Services { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the new timer defaults asynchronous.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Task{TimerInfo}.</returns>
|
|
|
|
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);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Cancels the timer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
Task CancelTimer(string id);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Cancels the series timer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
Task CancelSeriesTimer(string id);
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the recordings.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
2021-08-04 00:08:15 -04:00
|
|
|
/// <returns>A recording.</returns>
|
2023-03-01 12:57:23 -05:00
|
|
|
Task<QueryResult<BaseItemDto>> GetRecordingsAsync(RecordingQuery query, DtoOptions options);
|
2018-12-27 18:27:57 -05: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);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the series timers.
|
|
|
|
/// </summary>
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
/// <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>
|
2020-05-20 13:07:53 -04:00
|
|
|
Task<BaseItemDto> GetProgram(string id, CancellationToken cancellationToken, User user = null);
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the programs.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>IEnumerable{ProgramInfo}.</returns>
|
|
|
|
Task<QueryResult<BaseItemDto>> GetPrograms(InternalItemsQuery query, DtoOptions options, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the recommended programs.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2021-08-04 00:08:15 -04:00
|
|
|
/// <returns>Recommended programs.</returns>
|
2022-01-22 10:48:31 -05:00
|
|
|
Task<QueryResult<BaseItemDto>> GetRecommendedProgramsAsync(InternalItemsQuery query, DtoOptions options, CancellationToken cancellationToken);
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the recommended programs internal.
|
|
|
|
/// </summary>
|
2021-08-04 00:08:15 -04:00
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Recommended programs.</returns>
|
2018-12-27 18:27:57 -05:00
|
|
|
QueryResult<BaseItem> GetRecommendedProgramsInternal(InternalItemsQuery query, DtoOptions options, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the live tv information.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Task{LiveTvInfo}.</returns>
|
|
|
|
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);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the live tv folder.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2021-08-04 00:08:15 -04:00
|
|
|
/// <returns>Live TV folder.</returns>
|
2018-12-27 18:27:57 -05:00
|
|
|
Folder GetInternalLiveTvFolder(CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the enabled users.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>IEnumerable{User}.</returns>
|
2020-05-20 13:07:53 -04:00
|
|
|
IEnumerable<User> GetEnabledUsers();
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the internal channels.
|
|
|
|
/// </summary>
|
2021-08-04 00:08:15 -04:00
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <param name="dtoOptions">The options.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Internal channels.</returns>
|
2018-12-27 18:27:57 -05:00
|
|
|
QueryResult<BaseItem> GetInternalChannels(LiveTvChannelQuery query, DtoOptions dtoOptions, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Adds the information to program dto.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="programs">The programs.</param>
|
|
|
|
/// <param name="fields">The fields.</param>
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2021-12-24 16:18:24 -05:00
|
|
|
Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem Item, BaseItemDto ItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null);
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Adds the channel information.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="items">The items.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="user">The user.</param>
|
2021-12-24 16:18:24 -05:00
|
|
|
void AddChannelInfo(IReadOnlyCollection<(BaseItemDto ItemDto, LiveTvChannel Channel)> items, DtoOptions options, User user);
|
2018-12-27 18:27:57 -05:00
|
|
|
|
2020-05-20 13:07:53 -04:00
|
|
|
void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, ActiveRecordingInfo activeRecordingInfo, User user = null);
|
2018-12-27 18:27:57 -05:00
|
|
|
|
2023-03-01 12:57:23 -05:00
|
|
|
Task<BaseItem[]> GetRecordingFoldersAsync(User user);
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
}
|