diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-07 23:20:31 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-07 23:20:31 -0500 |
| commit | c6bd890cb2976c4cbf5c278a5987320dcb631652 (patch) | |
| tree | 37d61bcfc4c5416af9858feb987322e6cd9918f7 | |
| parent | 9b55579a855cbdd0feec0caff0398f0771edca9e (diff) | |
refined collection editing
| -rw-r--r-- | MediaBrowser.Controller/Collections/CollectionCreationOptions.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Collections/CollectionManager.cs | 8 |
2 files changed, 17 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs index 089f9b6ad..e147e0905 100644 --- a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs +++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs @@ -1,13 +1,22 @@ -using System; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; namespace MediaBrowser.Controller.Collections { - public class CollectionCreationOptions + 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 CollectionCreationOptions() + { + ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } } } diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs index 5a5dfdd3e..1cfcef514 100644 --- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs +++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs @@ -30,7 +30,10 @@ namespace MediaBrowser.Server.Implementations.Collections { var name = options.Name; - var folderName = _fileSystem.GetValidFilename(name); + // Need to use the [boxset] suffix + // If internet metadata is not found, or if xml saving is off there will be no collection.xml + // This could cause it to get re-resolved as a plain folder + var folderName = _fileSystem.GetValidFilename(name) + " [boxset]"; var parentFolder = GetParentFolder(options.ParentId); @@ -53,7 +56,8 @@ namespace MediaBrowser.Server.Implementations.Collections Parent = parentFolder, DisplayMediaType = "Collection", Path = path, - DontFetchMeta = options.IsLocked + DontFetchMeta = options.IsLocked, + ProviderIds = options.ProviderIds }; await parentFolder.AddChild(collection, CancellationToken.None).ConfigureAwait(false); |
