Increment library number instead of appending

pull/7013/head
Joe Rogers 3 years ago
parent 232a148d3f
commit 077f13ae4c
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

@ -2890,11 +2890,12 @@ namespace Emby.Server.Implementations.Library
var rootFolderPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath;
var existingNameCount = 1; // first numbered name will be 2
var virtualFolderPath = Path.Combine(rootFolderPath, name);
while (Directory.Exists(virtualFolderPath))
{
name += "1";
virtualFolderPath = Path.Combine(rootFolderPath, name);
existingNameCount++;
virtualFolderPath = Path.Combine(rootFolderPath, name + " " + existingNameCount);
}
var mediaPathInfos = options.PathInfos;

Loading…
Cancel
Save