aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryStructureService.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-03-25 13:52:15 -0400
committerLuke <luke.pulverenti@gmail.com>2016-03-25 13:52:15 -0400
commit72fe76ab1008f0bd38157cc37cde45797b5f6417 (patch)
tree875b6bee7d0a634d7ef019cfb7c434823b223001 /MediaBrowser.Api/Library/LibraryStructureService.cs
parent736e63241011cb9ae798bf4091cd37e097045c21 (diff)
parentf6c18200bacae6e768225a8c073418a170d349bd (diff)
Merge pull request #1593 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs8
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);
}
}
}