From 05b95001754bb72d67e3f8289b53a14348dc6577 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Mon, 4 Mar 2013 11:42:19 -0500 Subject: [PATCH] fixed remove path validation --- MediaBrowser.Api/Library/LibraryHelpers.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs index 2a3a04537e..e956e214db 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); } ///