2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Model.Configuration;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Model.Providers;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Subtitles
|
|
|
|
{
|
|
|
|
public interface ISubtitleManager
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Occurs when [subtitle download failure].
|
|
|
|
/// </summary>
|
|
|
|
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Adds the parts.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="subtitleProviders">The subtitle providers.</param>
|
|
|
|
void AddParts(IEnumerable<ISubtitleProvider> subtitleProviders);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Searches the subtitles.
|
|
|
|
/// </summary>
|
2019-09-10 20:37:53 +00:00
|
|
|
Task<RemoteSubtitleInfo[]> SearchSubtitles(
|
|
|
|
Video video,
|
2018-12-27 23:27:57 +00:00
|
|
|
string language,
|
|
|
|
bool? isPerfectMatch,
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Searches the subtitles.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2019-09-10 20:37:53 +00:00
|
|
|
/// <returns>Task{RemoteSubtitleInfo[]}.</returns>
|
|
|
|
Task<RemoteSubtitleInfo[]> SearchSubtitles(
|
|
|
|
SubtitleSearchRequest request,
|
2018-12-27 23:27:57 +00:00
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Downloads the subtitles.
|
|
|
|
/// </summary>
|
|
|
|
Task DownloadSubtitles(Video video, string subtitleId, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Downloads the subtitles.
|
|
|
|
/// </summary>
|
|
|
|
Task DownloadSubtitles(Video video, LibraryOptions libraryOptions, string subtitleId, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the remote subtitles.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2019-09-10 20:37:53 +00:00
|
|
|
/// <returns><see cref="Task{SubtitleResponse}" />.</returns>
|
2018-12-27 23:27:57 +00:00
|
|
|
Task<SubtitleResponse> GetRemoteSubtitles(string id, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deletes the subtitles.
|
|
|
|
/// </summary>
|
|
|
|
Task DeleteSubtitles(BaseItem item, int index);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the providers.
|
|
|
|
/// </summary>
|
|
|
|
SubtitleProviderInfo[] GetSupportedProviders(BaseItem item);
|
|
|
|
}
|
|
|
|
}
|