Merge pull request #7013 from 1337joe/increment-library-names

This commit is contained in:
Cody Robibero 2021-12-19 11:32:06 -07:00 committed by GitHub
commit a633a3052f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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