diff options
Diffstat (limited to 'MediaBrowser.Controller/Collections')
3 files changed, 121 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs new file mode 100644 index 000000000..727b487a7 --- /dev/null +++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs @@ -0,0 +1,27 @@ +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Collections +{ + public class CollectionCreationOptions : IHasProviderIds + { + public string Name { get; set; } + + public Guid? ParentId { get; set; } + + public bool IsLocked { get; set; } + + public Dictionary<string, string> ProviderIds { get; set; } + + public string[] ItemIdList { get; set; } + public Guid[] UserIds { get; set; } + + public CollectionCreationOptions() + { + ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + ItemIdList = new string[] {}; + UserIds = new Guid[] {}; + } + } +} diff --git a/MediaBrowser.Controller/Collections/CollectionEvents.cs b/MediaBrowser.Controller/Collections/CollectionEvents.cs new file mode 100644 index 000000000..80f66a444 --- /dev/null +++ b/MediaBrowser.Controller/Collections/CollectionEvents.cs @@ -0,0 +1,37 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Collections +{ + public class CollectionCreatedEventArgs : EventArgs + { + /// <summary> + /// Gets or sets the collection. + /// </summary> + /// <value>The collection.</value> + public BoxSet Collection { get; set; } + + /// <summary> + /// Gets or sets the options. + /// </summary> + /// <value>The options.</value> + public CollectionCreationOptions Options { get; set; } + } + + public class CollectionModifiedEventArgs : EventArgs + { + /// <summary> + /// Gets or sets the collection. + /// </summary> + /// <value>The collection.</value> + public BoxSet Collection { get; set; } + + /// <summary> + /// Gets or sets the items changed. + /// </summary> + /// <value>The items changed.</value> + public List<BaseItem> ItemsChanged { get; set; } + } +} diff --git a/MediaBrowser.Controller/Collections/ICollectionManager.cs b/MediaBrowser.Controller/Collections/ICollectionManager.cs new file mode 100644 index 000000000..05bc927ba --- /dev/null +++ b/MediaBrowser.Controller/Collections/ICollectionManager.cs @@ -0,0 +1,57 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Collections +{ + public interface ICollectionManager + { + /// <summary> + /// Occurs when [collection created]. + /// </summary> + event EventHandler<CollectionCreatedEventArgs> CollectionCreated; + + /// <summary> + /// Occurs when [items added to collection]. + /// </summary> + event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection; + + /// <summary> + /// Occurs when [items removed from collection]. + /// </summary> + event EventHandler<CollectionModifiedEventArgs> ItemsRemovedFromCollection; + + /// <summary> + /// Creates the collection. + /// </summary> + /// <param name="options">The options.</param> + BoxSet CreateCollection(CollectionCreationOptions options); + + /// <summary> + /// Adds to collection. + /// </summary> + /// <param name="collectionId">The collection identifier.</param> + /// <param name="itemIds">The item ids.</param> + void AddToCollection(Guid collectionId, IEnumerable<string> itemIds); + + /// <summary> + /// Removes from collection. + /// </summary> + /// <param name="collectionId">The collection identifier.</param> + /// <param name="itemIds">The item ids.</param> + void RemoveFromCollection(Guid collectionId, IEnumerable<string> itemIds); + + void AddToCollection(Guid collectionId, IEnumerable<Guid> itemIds); + void RemoveFromCollection(Guid collectionId, IEnumerable<Guid> itemIds); + + /// <summary> + /// Collapses the items within box sets. + /// </summary> + /// <param name="items">The items.</param> + /// <param name="user">The user.</param> + /// <returns>IEnumerable{BaseItem}.</returns> + IEnumerable<BaseItem> CollapseItemsWithinBoxSets(IEnumerable<BaseItem> items, User user); + } +} |
