ICollectionManager.cs 2.2 KB

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