aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryHelpers.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryHelpers.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs
index 2a3a04537..e956e214d 100644
--- a/MediaBrowser.Api/Library/LibraryHelpers.cs
+++ b/MediaBrowser.Api/Library/LibraryHelpers.cs
@@ -98,16 +98,15 @@ namespace MediaBrowser.Api.Library
if (!Directory.Exists(path))
{
- throw new DirectoryNotFoundException("The media folder does not exist");
+ throw new DirectoryNotFoundException(string.Format("The media collection {0} does not exist", virtualFolderName));
}
var shortcut = Directory.EnumerateFiles(path, "*.lnk", SearchOption.AllDirectories).FirstOrDefault(f => FileSystem.ResolveShortcut(f).Equals(mediaPath, StringComparison.OrdinalIgnoreCase));
- if (string.IsNullOrEmpty(shortcut))
+ if (!string.IsNullOrEmpty(shortcut))
{
- throw new DirectoryNotFoundException("The media folder does not exist");
+ File.Delete(shortcut);
}
- File.Delete(shortcut);
}
/// <summary>