The Free Software Media System - Server Backend & API
Add new params to collection creation
Luke Pulverenti9a6afa92889c
diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.csindex e147e09056..74ae420950 100644--- a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs+++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs@@ -14,9 +14,12 @@ namespace MediaBrowser.Controller.Collectionspublic Dictionary<string, string> ProviderIds { get; set; }+ public List<Guid> ItemIdList { get; set; }+public CollectionCreationOptions(){ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);+ ItemIdList = new List<Guid>();}}}diff --git a/MediaBrowser.Controller/Collections/ICollectionManager.cs b/MediaBrowser.Controller/Collections/ICollectionManager.csindex d7bc178ad3..af65bbacaf 100644--- a/MediaBrowser.Controller/Collections/ICollectionManager.cs+++ b/MediaBrowser.Controller/Collections/ICollectionManager.cs@@ -1,4 +1,5 @@-using System;+using MediaBrowser.Controller.Entities.Movies;+using System;using System.Collections.Generic;using System.Threading.Tasks;@@ -11,7 +12,7 @@ namespace MediaBrowser.Controller.Collections/// </summary>/// <param name="options">The options.</param>/// <returns>Task.</returns>- Task CreateCollection(CollectionCreationOptions options);+ Task<BoxSet> CreateCollection(CollectionCreationOptions options);/// <summary>/// Adds to collection.diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.csindex 8e70c1d3dc..60d631c1ad 100644--- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs+++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs@@ -26,7 +26,7 @@ namespace MediaBrowser.Server.Implementations.Collections_iLibraryMonitor = iLibraryMonitor;}- public async Task CreateCollection(CollectionCreationOptions options)+ public async Task<BoxSet> CreateCollection(CollectionCreationOptions options){var name = options.Name;@@ -64,6 +64,13 @@ namespace MediaBrowser.Server.Implementations.Collectionsawait collection.RefreshMetadata(new MetadataRefreshOptions(), CancellationToken.None).ConfigureAwait(false);++ if (options.ItemIdList.Count > 0)+ {+ await AddToCollection(collection.Id, options.ItemIdList);+ }++ return collection;}finally{