浏览代码

Increment library number instead of appending

Joe Rogers 3 年之前
父节点
当前提交
077f13ae4c
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Emby.Server.Implementations/Library/LibraryManager.cs

+ 3 - 2
Emby.Server.Implementations/Library/LibraryManager.cs

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