repo creation with initial code after cloning public repo
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
public interface ISubtitleManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [subtitle download failure].
|
||||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <summary>
|
||||
/// Searches the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="video">The video.</param>
|
||||
/// <param name="language">Subtitle language.</param>
|
||||
/// <param name="isPerfectMatch">Require perfect match.</param>
|
||||
/// <param name="isAutomated">Request is automated.</param>
|
||||
/// <param name="cancellationToken">CancellationToken to use for the operation.</param>
|
||||
/// <returns>Subtitles, wrapped in task.</returns>
|
||||
Task<RemoteSubtitleInfo[]> SearchSubtitles(
|
||||
Video video,
|
||||
string language,
|
||||
bool? isPerfectMatch,
|
||||
bool isAutomated,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Searches the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{RemoteSubtitleInfo[]}.</returns>
|
||||
Task<RemoteSubtitleInfo[]> SearchSubtitles(
|
||||
SubtitleSearchRequest request,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="video">The video.</param>
|
||||
/// <param name="subtitleId">Subtitle ID.</param>
|
||||
/// <param name="cancellationToken">CancellationToken to use for the operation.</param>
|
||||
/// <returns>A task.</returns>
|
||||
Task DownloadSubtitles(Video video, string subtitleId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="video">The video.</param>
|
||||
/// <param name="libraryOptions">Library options to use.</param>
|
||||
/// <param name="subtitleId">Subtitle ID.</param>
|
||||
/// <param name="cancellationToken">CancellationToken to use for the operation.</param>
|
||||
/// <returns>A task.</returns>
|
||||
Task DownloadSubtitles(Video video, LibraryOptions libraryOptions, string subtitleId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Upload new subtitle.
|
||||
/// </summary>
|
||||
/// <param name="video">The video the subtitle belongs to.</param>
|
||||
/// <param name="response">The subtitle response.</param>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
Task UploadSubtitle(Video video, SubtitleResponse response);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remote subtitles.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns><see cref="Task{SubtitleResponse}" />.</returns>
|
||||
Task<SubtitleResponse> GetRemoteSubtitles(string id, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="item">Media item.</param>
|
||||
/// <param name="index">Subtitle index.</param>
|
||||
/// <returns>A task.</returns>
|
||||
Task DeleteSubtitles(BaseItem item, int index);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the providers.
|
||||
/// </summary>
|
||||
/// <param name="item">The media item.</param>
|
||||
/// <returns>Subtitles providers.</returns>
|
||||
SubtitleProviderInfo[] GetSupportedProviders(BaseItem item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
public interface ISubtitleProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the supported media types.
|
||||
/// </summary>
|
||||
/// <value>The supported media types.</value>
|
||||
IEnumerable<VideoContentType> SupportedMediaTypes { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Searches the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{RemoteSubtitleInfo}}.</returns>
|
||||
Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the subtitles.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{SubtitleResponse}.</returns>
|
||||
Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when subtitle downloading fails.
|
||||
/// </summary>
|
||||
public class SubtitleDownloadFailureEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the item.
|
||||
/// </summary>
|
||||
public BaseItem Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the provider.
|
||||
/// </summary>
|
||||
public string Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the exception.
|
||||
/// </summary>
|
||||
public Exception Exception { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
public class SubtitleResponse
|
||||
{
|
||||
public string Language { get; set; }
|
||||
|
||||
public string Format { get; set; }
|
||||
|
||||
public bool IsForced { get; set; }
|
||||
|
||||
public bool IsHearingImpaired { get; set; }
|
||||
|
||||
public Stream Stream { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
public class SubtitleSearchRequest : IHasProviderIds
|
||||
{
|
||||
public SubtitleSearchRequest()
|
||||
{
|
||||
SearchAllProviders = true;
|
||||
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
DisabledSubtitleFetchers = Array.Empty<string>();
|
||||
SubtitleFetcherOrder = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public string TwoLetterISOLanguageName { get; set; }
|
||||
|
||||
public VideoContentType ContentType { get; set; }
|
||||
|
||||
public string MediaPath { get; set; }
|
||||
|
||||
public string SeriesName { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public int? IndexNumber { get; set; }
|
||||
|
||||
public int? IndexNumberEnd { get; set; }
|
||||
|
||||
public int? ParentIndexNumber { get; set; }
|
||||
|
||||
public int? ProductionYear { get; set; }
|
||||
|
||||
public long? RuntimeTicks { get; set; }
|
||||
|
||||
public bool IsPerfectMatch { get; set; }
|
||||
|
||||
public Dictionary<string, string> ProviderIds { get; set; }
|
||||
|
||||
public bool SearchAllProviders { get; set; }
|
||||
|
||||
public string[] DisabledSubtitleFetchers { get; set; }
|
||||
|
||||
public string[] SubtitleFetcherOrder { get; set; }
|
||||
|
||||
public bool IsAutomated { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user