Update name so media paths store to correct library

This commit is contained in:
Joe Rogers 2022-03-30 15:20:57 +02:00
parent ca67a48140
commit 784ed796ce
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4
1 changed files with 3 additions and 1 deletions

View File

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