2014-05-07 02:28:19 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Model.Providers;
|
2014-08-10 22:13:17 +00:00
|
|
|
|
using System;
|
2014-05-07 02:28:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Subtitles
|
|
|
|
|
{
|
|
|
|
|
public interface ISubtitleManager
|
|
|
|
|
{
|
2014-08-10 22:13:17 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [subtitle download failure].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [subtitles downloaded].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<SubtitleDownloadEventArgs> SubtitlesDownloaded;
|
|
|
|
|
|
2014-05-07 02:28:19 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the parts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="subtitleProviders">The subtitle providers.</param>
|
|
|
|
|
void AddParts(IEnumerable<ISubtitleProvider> subtitleProviders);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Searches the subtitles.
|
|
|
|
|
/// </summary>
|
2017-08-19 19:43:35 +00:00
|
|
|
|
Task<RemoteSubtitleInfo[]> SearchSubtitles(Video video,
|
2014-05-07 02:28:19 +00:00
|
|
|
|
string language,
|
2017-06-30 19:58:53 +00:00
|
|
|
|
bool? isPerfectMatch,
|
2014-05-07 02:28:19 +00:00
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Searches the subtitles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{RemoteSubtitleInfo}}.</returns>
|
2017-08-19 19:43:35 +00:00
|
|
|
|
Task<RemoteSubtitleInfo[]> SearchSubtitles(SubtitleSearchRequest request,
|
2014-05-07 02:28:19 +00:00
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Downloads the subtitles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="video">The video.</param>
|
|
|
|
|
/// <param name="subtitleId">The subtitle identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-08-10 22:13:17 +00:00
|
|
|
|
Task DownloadSubtitles(Video video,
|
|
|
|
|
string subtitleId,
|
2014-05-07 02:28:19 +00:00
|
|
|
|
CancellationToken cancellationToken);
|
2014-05-17 04:24:10 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the remote subtitles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{SubtitleResponse}.</returns>
|
|
|
|
|
Task<SubtitleResponse> GetRemoteSubtitles(string id, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes the subtitles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="itemId">The item identifier.</param>
|
|
|
|
|
/// <param name="index">The index.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task DeleteSubtitles(string itemId, int index);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the providers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="itemId">The item identifier.</param>
|
|
|
|
|
/// <returns>IEnumerable{SubtitleProviderInfo}.</returns>
|
2017-08-19 19:43:35 +00:00
|
|
|
|
SubtitleProviderInfo[] GetProviders(string itemId);
|
2014-05-07 02:28:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|