ICollectionManager.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using Jellyfin.Data.Entities;
  5. using MediaBrowser.Controller.Entities;
  6. using MediaBrowser.Controller.Entities.Movies;
  7. namespace MediaBrowser.Controller.Collections
  8. {
  9. public interface ICollectionManager
  10. {
  11. /// <summary>
  12. /// Occurs when [collection created].
  13. /// </summary>
  14. event EventHandler<CollectionCreatedEventArgs> CollectionCreated;
  15. /// <summary>
  16. /// Occurs when [items added to collection].
  17. /// </summary>
  18. event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection;
  19. /// <summary>
  20. /// Occurs when [items removed from collection].
  21. /// </summary>
  22. event EventHandler<CollectionModifiedEventArgs> ItemsRemovedFromCollection;
  23. /// <summary>
  24. /// Creates the collection.
  25. /// </summary>
  26. /// <param name="options">The options.</param>
  27. Task<BoxSet> CreateCollectionAsync(CollectionCreationOptions options);
  28. /// <summary>
  29. /// Adds to collection.
  30. /// </summary>
  31. /// <param name="collectionId">The collection identifier.</param>
  32. /// <param name="itemIds">The item ids.</param>
  33. /// <returns><see cref="Task"/> representing the asynchronous operation.</returns>
  34. Task AddToCollectionAsync(Guid collectionId, IEnumerable<Guid> itemIds);
  35. /// <summary>
  36. /// Removes from collection.
  37. /// </summary>
  38. /// <param name="collectionId">The collection identifier.</param>
  39. /// <param name="itemIds">The item ids.</param>
  40. /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
  41. Task RemoveFromCollectionAsync(Guid collectionId, IEnumerable<Guid> itemIds);
  42. /// <summary>
  43. /// Collapses the items within box sets.
  44. /// </summary>
  45. /// <param name="items">The items.</param>
  46. /// <param name="user">The user.</param>
  47. /// <returns>IEnumerable{BaseItem}.</returns>
  48. IEnumerable<BaseItem> CollapseItemsWithinBoxSets(IEnumerable<BaseItem> items, User user);
  49. }
  50. }