diff options
| author | Tim Eisele <Ghost_of_Stone@web.de> | 2025-04-26 14:01:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 14:01:12 +0200 |
| commit | df5671263fc8370ae17b7a5d53f06a86de5cbc93 (patch) | |
| tree | 91e703628c257bd07ce943eb9934b63714e92e75 /MediaBrowser.Controller/Chapters/IChapterManager.cs | |
| parent | f35b8dd33d97309e91bafb58db937352e47e4300 (diff) | |
Merge pull request #13847 from Shadowghost/rework-chapter-management
Rework chapter management
Diffstat (limited to 'MediaBrowser.Controller/Chapters/IChapterManager.cs')
| -rw-r--r-- | MediaBrowser.Controller/Chapters/IChapterManager.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Chapters/IChapterManager.cs b/MediaBrowser.Controller/Chapters/IChapterManager.cs new file mode 100644 index 000000000..7532e56c6 --- /dev/null +++ b/MediaBrowser.Controller/Chapters/IChapterManager.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Controller.Chapters; + +/// <summary> +/// Interface IChapterManager. +/// </summary> +public interface IChapterManager +{ + /// <summary> + /// Saves the chapters. + /// </summary> + /// <param name="video">The video.</param> + /// <param name="chapters">The set of chapters.</param> + void SaveChapters(Video video, IReadOnlyList<ChapterInfo> chapters); + + /// <summary> + /// Gets a single chapter of a BaseItem on a specific index. + /// </summary> + /// <param name="baseItemId">The BaseItems id.</param> + /// <param name="index">The index of that chapter.</param> + /// <returns>A chapter instance.</returns> + ChapterInfo? GetChapter(Guid baseItemId, int index); + + /// <summary> + /// Gets all chapters associated with the baseItem. + /// </summary> + /// <param name="baseItemId">The BaseItems id.</param> + /// <returns>A readonly list of chapter instances.</returns> + IReadOnlyList<ChapterInfo> GetChapters(Guid baseItemId); + + /// <summary> + /// Refreshes the chapter images. + /// </summary> + /// <param name="video">Video to use.</param> + /// <param name="directoryService">Directory service to use.</param> + /// <param name="chapters">Set of chapters to refresh.</param> + /// <param name="extractImages">Option to extract images.</param> + /// <param name="saveChapters">Option to save chapters.</param> + /// <param name="cancellationToken">CancellationToken to use for operation.</param> + /// <returns><c>true</c> if successful, <c>false</c> if not.</returns> + Task<bool> RefreshChapterImages(Video video, IDirectoryService directoryService, IReadOnlyList<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken); + + /// <summary> + /// Deletes the chapter images. + /// </summary> + /// <param name="video">Video to use.</param> + void DeleteChapterImages(Video video); +} |
