diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-12-19 11:32:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-19 11:32:06 -0700 |
| commit | a633a3052fa943be93d38bd5165cc67df84954f5 (patch) | |
| tree | fa6efb969476c592add32733f0441938eed53bda | |
| parent | e8ae501430afca04a24200c2151a8907be3a0db6 (diff) | |
| parent | 077f13ae4c949c11d06734d8fc3d44b6411edcc8 (diff) | |
Merge pull request #7013 from 1337joe/increment-library-names
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 8cc9a2fd5..411d9675f 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/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; |
