The Free Software Media System - Server Backend & API
Increment library number instead of appending
Joe Rogers077f13ae4c94
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex 8cc9a2fd5e..411d9675f1 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -2890,11 +2890,12 @@ namespace Emby.Server.Implementations.Libraryvar rootFolderPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath;+ var existingNameCount = 1; // first numbered name will be 2var 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;