aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Controller/Collections/CollectionCreationOptions.cs3
-rw-r--r--MediaBrowser.Controller/Collections/ICollectionManager.cs5
-rw-r--r--MediaBrowser.Server.Implementations/Collections/CollectionManager.cs9
3 files changed, 14 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
index e147e0905..74ae42095 100644
--- a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
+++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
@@ -14,9 +14,12 @@ namespace MediaBrowser.Controller.Collections
public 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.cs
index d7bc178ad..af65bbaca 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.cs
index 8e70c1d3d..60d631c1a 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.Collections
await collection.RefreshMetadata(new MetadataRefreshOptions(), CancellationToken.None)
.ConfigureAwait(false);
+
+ if (options.ItemIdList.Count > 0)
+ {
+ await AddToCollection(collection.Id, options.ItemIdList);
+ }
+
+ return collection;
}
finally
{