ICollectionManager.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. using Jellyfin.Database.Implementations.Entities;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Controller.Entities.Movies;
  8. namespace MediaBrowser.Controller.Collections
  9. {
  10. public interface ICollectionManager
  11. {
  12. /// <summary>
  13. /// Occurs when [collection created].
  14. /// </summary>
  15. event EventHandler<CollectionCreatedEventArgs>? CollectionCreated;
  16. /// <summary>
  17. /// Occurs when [items added to collection].
  18. /// </summary>
  19. event EventHandler<CollectionModifiedEventArgs>? ItemsAddedToCollection;
  20. /// <summary>
  21. /// Occurs when [items removed from collection].
  22. /// </summary>
  23. event EventHandler<CollectionModifiedEventArgs>? ItemsRemovedFromCollection;
  24. /// <summary>
  25. /// Creates the collection.
  26. /// </summary>
  27. /// <param name="options">The options.</param>
  28. /// <returns>BoxSet wrapped in an awaitable task.</returns>
  29. Task<BoxSet> CreateCollectionAsync(CollectionCreationOptions options);
  30. /// <summary>
  31. /// Adds to collection.
  32. /// </summary>
  33. /// <param name="collectionId">The collection identifier.</param>
  34. /// <param name="itemIds">The item ids.</param>
  35. /// <returns><see cref="Task"/> representing the asynchronous operation.</returns>
  36. Task AddToCollectionAsync(Guid collectionId, IEnumerable<Guid> itemIds);
  37. /// <summary>
  38. /// Removes from collection.
  39. /// </summary>
  40. /// <param name="collectionId">The collection identifier.</param>
  41. /// <param name="itemIds">The item ids.</param>
  42. /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
  43. Task RemoveFromCollectionAsync(Guid collectionId, IEnumerable<Guid> itemIds);
  44. /// <summary>
  45. /// Collapses the items within box sets.
  46. /// </summary>
  47. /// <param name="items">The items.</param>
  48. /// <param name="user">The user.</param>
  49. /// <returns>IEnumerable{BaseItem}.</returns>
  50. IEnumerable<BaseItem> CollapseItemsWithinBoxSets(IEnumerable<BaseItem> items, User user);
  51. /// <summary>
  52. /// Gets the folder where collections are stored.
  53. /// </summary>
  54. /// <param name="createIfNeeded">Will create the collection folder on the storage if set to true.</param>
  55. /// <returns>The folder instance referencing the collection storage.</returns>
  56. Task<Folder?> GetCollectionsFolder(bool createIfNeeded);
  57. }
  58. }