diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-03-18 12:30:50 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-03-18 12:30:50 -0400 |
| commit | 5a750be1e3ee83cd46b7ca17742a844b03e55bf6 (patch) | |
| tree | d291ce62ed5f40608e293c336fd06ace6accc497 /MediaBrowser.Api/Library/LibraryStructureService.cs | |
| parent | 4863fc5b31462f0c582e5db23125112a4361bd4f (diff) | |
| parent | 641b85ad7b69d9dc5e853b99da51d1a10aefc095 (diff) | |
Merge pull request #1558 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryStructureService.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index decd19602..82931e11e 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -201,10 +201,10 @@ namespace MediaBrowser.Api.Library var rootFolderPath = _appPaths.DefaultUserViewsPath; var virtualFolderPath = Path.Combine(rootFolderPath, name); - - if (_fileSystem.DirectoryExists(virtualFolderPath)) + while (_fileSystem.DirectoryExists(virtualFolderPath)) { - throw new ArgumentException("There is already a media library with the name " + name + "."); + name += "1"; + virtualFolderPath = Path.Combine(rootFolderPath, name); } if (request.Paths != null) @@ -236,7 +236,7 @@ namespace MediaBrowser.Api.Library { foreach (var path in request.Paths) { - LibraryHelpers.AddMediaPath(_fileSystem, request.Name, path, _appPaths); + LibraryHelpers.AddMediaPath(_fileSystem, name, path, _appPaths); } } } |
