ICollectionManager.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Entities.Movies;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Collections
  7. {
  8. public interface ICollectionManager
  9. {
  10. /// <summary>
  11. /// Occurs when [collection created].
  12. /// </summary>
  13. event EventHandler<CollectionCreatedEventArgs> CollectionCreated;
  14. /// <summary>
  15. /// Occurs when [items added to collection].
  16. /// </summary>
  17. event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection;
  18. /// <summary>
  19. /// Occurs when [items removed from collection].
  20. /// </summary>
  21. event EventHandler<CollectionModifiedEventArgs> ItemsRemovedFromCollection;
  22. /// <summary>
  23. /// Creates the collection.
  24. /// </summary>
  25. /// <param name="options">The options.</param>
  26. /// <returns>Task.</returns>
  27. Task<BoxSet> CreateCollection(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>Task.</returns>
  34. Task AddToCollection(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>Task.</returns>
  41. Task RemoveFromCollection(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. /// <summary>
  50. /// Gets the collections folder.
  51. /// </summary>
  52. /// <param name="userId">The user identifier.</param>
  53. /// <returns>Folder.</returns>
  54. Folder GetCollectionsFolder(string userId);
  55. /// <summary>
  56. /// Gets the collections.
  57. /// </summary>
  58. /// <param name="user">The user.</param>
  59. /// <returns>IEnumerable&lt;BoxSet&gt;.</returns>
  60. IEnumerable<BoxSet> GetCollections(User user);
  61. }
  62. }