aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryHelpers.cs
diff options
context:
space:
mode:
authorLuis Miguel Almánzar <ruisu15@gmail.com>2013-05-19 23:56:40 -0400
committerLuis Miguel Almánzar <ruisu15@gmail.com>2013-05-19 23:56:40 -0400
commit7b3edb8737fed4b73fe080ca12b655703b331508 (patch)
treed48195bd85563e1390e6c7eb880fc69dc8748650 /MediaBrowser.Api/Library/LibraryHelpers.cs
parent2f47265c4f945e6712fccc367a18a36ce3123fac (diff)
Allow capitalising change on virtual folders
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryHelpers.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryHelpers.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs
index 12b9d478f..67e1160f7 100644
--- a/MediaBrowser.Api/Library/LibraryHelpers.cs
+++ b/MediaBrowser.Api/Library/LibraryHelpers.cs
@@ -77,9 +77,12 @@ namespace MediaBrowser.Api.Library
if (!string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase) && Directory.Exists(newPath))
{
- throw new ArgumentException("There is already a media collection with the name " + newPath + ".");
+ //Create an unique name
+ var temporaryName = Guid.NewGuid().ToString();
+ var temporaryPath = Path.Combine(rootFolderPath, temporaryName);
+ Directory.Move(currentPath,temporaryPath);
+ currentPath = temporaryPath;
}
-
Directory.Move(currentPath, newPath);
}