Skip to content

The Free Software Media System - Server Backend & API

Allow capitalising change on virtual folders

Luis Miguel Almánzar7b3edb8737fe
diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs
index 12b9d478ff..67e1160f7f 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);
}