diff options
Diffstat (limited to 'MediaBrowser.Controller')
8 files changed, 155 insertions, 39 deletions
diff --git a/MediaBrowser.Controller/Chapters/ChapterResponse.cs b/MediaBrowser.Controller/Chapters/ChapterResponse.cs new file mode 100644 index 000000000..3c1b8ed07 --- /dev/null +++ b/MediaBrowser.Controller/Chapters/ChapterResponse.cs @@ -0,0 +1,19 @@ +using MediaBrowser.Model.Chapters; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Chapters +{ + public class ChapterResponse + { + /// <summary> + /// Gets or sets the chapters. + /// </summary> + /// <value>The chapters.</value> + public List<RemoteChapterInfo> Chapters { get; set; } + + public ChapterResponse() + { + Chapters = new List<RemoteChapterInfo>(); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs b/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs new file mode 100644 index 000000000..9a53d68ea --- /dev/null +++ b/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs @@ -0,0 +1,29 @@ +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Chapters +{ + public class ChapterSearchRequest : IHasProviderIds + { + public string Language { 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 Dictionary<string, string> ProviderIds { get; set; } + + public ChapterSearchRequest() + { + ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Controller/Chapters/IChapterProvider.cs b/MediaBrowser.Controller/Chapters/IChapterProvider.cs new file mode 100644 index 000000000..a7505347b --- /dev/null +++ b/MediaBrowser.Controller/Chapters/IChapterProvider.cs @@ -0,0 +1,39 @@ +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Chapters; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Chapters +{ + public interface IChapterProvider + { + /// <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 specified request. + /// </summary> + /// <param name="request">The request.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{IEnumerable{RemoteChapterResult}}.</returns> + Task<IEnumerable<RemoteChapterResult>> Search(ChapterSearchRequest request, CancellationToken cancellationToken); + + /// <summary> + /// Gets the chapters. + /// </summary> + /// <param name="id">The identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{ChapterResponse}.</returns> + Task<ChapterResponse> GetChapters(string id, CancellationToken cancellationToken); + } +} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 6a7557e3a..c7c4c5b5f 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -77,6 +77,9 @@ <Compile Include="Channels\ChannelAudioItem.cs" /> <Compile Include="Channels\ChannelVideoItem.cs" /> <Compile Include="Channels\Channel.cs" /> + <Compile Include="Chapters\ChapterSearchRequest.cs" /> + <Compile Include="Chapters\IChapterProvider.cs" /> + <Compile Include="Chapters\ChapterResponse.cs" /> <Compile Include="Collections\CollectionCreationOptions.cs" /> <Compile Include="Collections\ICollectionManager.cs" /> <Compile Include="Dlna\ControlRequest.cs" /> @@ -191,6 +194,7 @@ <Compile Include="Providers\IMetadataProvider.cs" /> <Compile Include="Providers\IMetadataService.cs" /> <Compile Include="Providers\IRemoteMetadataProvider.cs" /> + <Compile Include="Providers\VideoContentType.cs" /> <Compile Include="Security\IEncryptionManager.cs" /> <Compile Include="Subtitles\ISubtitleManager.cs" /> <Compile Include="Subtitles\ISubtitleProvider.cs" /> @@ -269,6 +273,8 @@ <Compile Include="Sorting\IUserBaseItemComparer.cs" /> <Compile Include="Providers\BaseItemXmlParser.cs" /> <Compile Include="Sorting\SortExtensions.cs" /> + <Compile Include="Subtitles\SubtitleResponse.cs" /> + <Compile Include="Subtitles\SubtitleSearchRequest.cs" /> <Compile Include="Themes\IAppThemeManager.cs" /> <Compile Include="Themes\InternalThemeImage.cs" /> </ItemGroup> diff --git a/MediaBrowser.Controller/Providers/VideoContentType.cs b/MediaBrowser.Controller/Providers/VideoContentType.cs new file mode 100644 index 000000000..903c77612 --- /dev/null +++ b/MediaBrowser.Controller/Providers/VideoContentType.cs @@ -0,0 +1,19 @@ + +namespace MediaBrowser.Controller.Providers +{ + /// <summary> + /// Enum VideoContentType + /// </summary> + public enum VideoContentType + { + /// <summary> + /// The episode + /// </summary> + Episode = 0, + + /// <summary> + /// The movie + /// </summary> + Movie = 1 + } +} diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs index 1409b7d50..dceea0cc6 100644 --- a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs +++ b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs @@ -1,8 +1,6 @@ -using MediaBrowser.Model.Entities; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Providers; -using System; using System.Collections.Generic; -using System.IO; using System.Threading; using System.Threading.Tasks; @@ -20,7 +18,7 @@ namespace MediaBrowser.Controller.Subtitles /// Gets the supported media types. /// </summary> /// <value>The supported media types.</value> - IEnumerable<SubtitleMediaType> SupportedMediaTypes { get; } + IEnumerable<VideoContentType> SupportedMediaTypes { get; } /// <summary> /// Searches the subtitles. @@ -28,7 +26,7 @@ namespace MediaBrowser.Controller.Subtitles /// <param name="request">The request.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{IEnumerable{RemoteSubtitleInfo}}.</returns> - Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken); + Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken); /// <summary> /// Gets the subtitles. @@ -38,38 +36,4 @@ namespace MediaBrowser.Controller.Subtitles /// <returns>Task{SubtitleResponse}.</returns> Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken); } - - public enum SubtitleMediaType - { - Episode = 0, - Movie = 1 - } - - public class SubtitleResponse - { - public string Language { get; set; } - public string Format { get; set; } - public Stream Stream { get; set; } - } - - public class SubtitleSearchRequest : IHasProviderIds - { - public string Language { get; set; } - - public SubtitleMediaType 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 Dictionary<string, string> ProviderIds { get; set; } - - public SubtitleSearchRequest() - { - ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); - } - } } diff --git a/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs b/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs new file mode 100644 index 000000000..69e92c1f5 --- /dev/null +++ b/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs @@ -0,0 +1,11 @@ +using System.IO; + +namespace MediaBrowser.Controller.Subtitles +{ + public class SubtitleResponse + { + public string Language { get; set; } + public string Format { get; set; } + public Stream Stream { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs new file mode 100644 index 000000000..e83387129 --- /dev/null +++ b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs @@ -0,0 +1,29 @@ +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Subtitles +{ + public class SubtitleSearchRequest : IHasProviderIds + { + public string Language { 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 Dictionary<string, string> ProviderIds { get; set; } + + public SubtitleSearchRequest() + { + ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } + } +}
\ No newline at end of file |
