IChapterManager.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Entities;
  6. using MediaBrowser.Controller.Providers;
  7. using MediaBrowser.Model.Entities;
  8. namespace MediaBrowser.Controller.Chapters;
  9. /// <summary>
  10. /// Interface IChapterManager.
  11. /// </summary>
  12. public interface IChapterManager
  13. {
  14. /// <summary>
  15. /// Saves the chapters.
  16. /// </summary>
  17. /// <param name="video">The video.</param>
  18. /// <param name="chapters">The set of chapters.</param>
  19. void SaveChapters(Video video, IReadOnlyList<ChapterInfo> chapters);
  20. /// <summary>
  21. /// Gets a single chapter of a BaseItem on a specific index.
  22. /// </summary>
  23. /// <param name="baseItemId">The BaseItems id.</param>
  24. /// <param name="index">The index of that chapter.</param>
  25. /// <returns>A chapter instance.</returns>
  26. ChapterInfo? GetChapter(Guid baseItemId, int index);
  27. /// <summary>
  28. /// Gets all chapters associated with the baseItem.
  29. /// </summary>
  30. /// <param name="baseItemId">The BaseItems id.</param>
  31. /// <returns>A readonly list of chapter instances.</returns>
  32. IReadOnlyList<ChapterInfo> GetChapters(Guid baseItemId);
  33. /// <summary>
  34. /// Refreshes the chapter images.
  35. /// </summary>
  36. /// <param name="video">Video to use.</param>
  37. /// <param name="directoryService">Directory service to use.</param>
  38. /// <param name="chapters">Set of chapters to refresh.</param>
  39. /// <param name="extractImages">Option to extract images.</param>
  40. /// <param name="saveChapters">Option to save chapters.</param>
  41. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  42. /// <returns><c>true</c> if successful, <c>false</c> if not.</returns>
  43. Task<bool> RefreshChapterImages(Video video, IDirectoryService directoryService, IReadOnlyList<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken);
  44. /// <summary>
  45. /// Deletes the chapter images.
  46. /// </summary>
  47. /// <param name="video">Video to use.</param>
  48. void DeleteChapterImages(Video video);
  49. }