mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
refined collection editing
This commit is contained in:
parent
9b55579a85
commit
c6bd890cb2
@ -1,13 +1,22 @@
|
|||||||
using System;
|
using MediaBrowser.Model.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Collections
|
namespace MediaBrowser.Controller.Collections
|
||||||
{
|
{
|
||||||
public class CollectionCreationOptions
|
public class CollectionCreationOptions : IHasProviderIds
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public Guid? ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
|
|
||||||
public bool IsLocked { get; set; }
|
public bool IsLocked { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<string, string> ProviderIds { get; set; }
|
||||||
|
|
||||||
|
public CollectionCreationOptions()
|
||||||
|
{
|
||||||
|
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,10 @@ namespace MediaBrowser.Server.Implementations.Collections
|
|||||||
{
|
{
|
||||||
var name = options.Name;
|
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);
|
var parentFolder = GetParentFolder(options.ParentId);
|
||||||
|
|
||||||
@ -53,7 +56,8 @@ namespace MediaBrowser.Server.Implementations.Collections
|
|||||||
Parent = parentFolder,
|
Parent = parentFolder,
|
||||||
DisplayMediaType = "Collection",
|
DisplayMediaType = "Collection",
|
||||||
Path = path,
|
Path = path,
|
||||||
DontFetchMeta = options.IsLocked
|
DontFetchMeta = options.IsLocked,
|
||||||
|
ProviderIds = options.ProviderIds
|
||||||
};
|
};
|
||||||
|
|
||||||
await parentFolder.AddChild(collection, CancellationToken.None).ConfigureAwait(false);
|
await parentFolder.AddChild(collection, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user