// // Copyright (c) PlaceholderCompany. All rights reserved. // namespace MediaBrowser.Controller.Chapters; 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; /// /// Interface IChapterManager. /// public interface IChapterManager { /// /// Saves the chapters. /// /// The video. /// The set of chapters. void SaveChapters(Video video, IReadOnlyList chapters); /// /// Saves the chapters asynchronously. /// /// The video. /// The set of chapters. /// The cancellation token. /// A task representing the asynchronous operation. Task SaveChaptersAsync(Video video, IReadOnlyList chapters, CancellationToken cancellationToken = default); /// /// Gets a single chapter of a BaseItem on a specific index. /// /// The BaseItems id. /// The index of that chapter. /// A chapter instance. ChapterInfo? GetChapter(Guid baseItemId, int index); /// /// Gets a single chapter of a BaseItem on a specific index asynchronously. /// /// The BaseItems id. /// The index of that chapter. /// The cancellation token. /// A chapter instance. Task GetChapterAsync(Guid baseItemId, int index, CancellationToken cancellationToken = default); /// /// Gets all chapters associated with the baseItem. /// /// The BaseItems id. /// A readonly list of chapter instances. IReadOnlyList GetChapters(Guid baseItemId); /// /// Gets all chapters associated with the baseItem asynchronously. /// /// The BaseItems id. /// The cancellation token. /// A readonly list of chapter instances. Task> GetChaptersAsync(Guid baseItemId, CancellationToken cancellationToken = default); /// /// Refreshes the chapter images. /// /// Video to use. /// Directory service to use. /// Set of chapters to refresh. /// Option to extract images. /// Option to save chapters. /// CancellationToken to use for operation. /// true if successful, false if not. Task RefreshChapterImages(Video video, IDirectoryService directoryService, IReadOnlyList chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken); /// /// Deletes the chapter data. /// /// The item id. /// The cancellation token. /// Task. Task DeleteChapterDataAsync(Guid itemId, CancellationToken cancellationToken); }