diff options
Diffstat (limited to 'MediaBrowser.Controller/Chapters')
| -rw-r--r-- | MediaBrowser.Controller/Chapters/ChapterResponse.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs | 29 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Chapters/IChapterProvider.cs | 39 |
3 files changed, 87 insertions, 0 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); + } +} |
