aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryHelpers.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-03-04 11:42:19 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-03-04 11:42:19 -0500
commit05b95001754bb72d67e3f8289b53a14348dc6577 (patch)
tree3e15f4be116f3f3a4a6eba2cb4b12cf13ca19365 /MediaBrowser.Api/Library/LibraryHelpers.cs
parent16b36d4d89abde2026eea57d60109bb3a50772fc (diff)
fixed remove path validation
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>