Add new params to collection creation

pull/702/head
Luke Pulverenti 10 years ago
parent d55af4f529
commit 9a6afa9288

@ -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>();
}
}
}

@ -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.

@ -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
{

Loading…
Cancel
Save