IChapterRepository.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Model.Entities;
  6. namespace MediaBrowser.Controller.Persistence;
  7. /// <summary>
  8. /// Interface IChapterRepository.
  9. /// </summary>
  10. public interface IChapterRepository
  11. {
  12. /// <summary>
  13. /// Deletes the chapters.
  14. /// </summary>
  15. /// <param name="itemId">The item.</param>
  16. /// <param name="cancellationToken">The cancellation token.</param>
  17. /// <returns>Task.</returns>
  18. Task DeleteChaptersAsync(Guid itemId, CancellationToken cancellationToken);
  19. /// <summary>
  20. /// Saves the chapters.
  21. /// </summary>
  22. /// <param name="itemId">The item.</param>
  23. /// <param name="chapters">The set of chapters.</param>
  24. void SaveChapters(Guid itemId, IReadOnlyList<ChapterInfo> chapters);
  25. /// <summary>
  26. /// Gets all chapters associated with the baseItem.
  27. /// </summary>
  28. /// <param name="baseItemId">The BaseItems id.</param>
  29. /// <returns>A readonly list of chapter instances.</returns>
  30. IReadOnlyList<ChapterInfo> GetChapters(Guid baseItemId);
  31. /// <summary>
  32. /// Gets a single chapter of a BaseItem on a specific index.
  33. /// </summary>
  34. /// <param name="baseItemId">The BaseItems id.</param>
  35. /// <param name="index">The index of that chapter.</param>
  36. /// <returns>A chapter instance.</returns>
  37. ChapterInfo? GetChapter(Guid baseItemId, int index);
  38. }