fixed remove path validation
This commit is contained in:
parent
16b36d4d89
commit
05b9500175
|
@ -98,17 +98,16 @@ namespace MediaBrowser.Api.Library
|
||||||
|
|
||||||
if (!Directory.Exists(path))
|
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));
|
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>
|
/// <summary>
|
||||||
/// Adds an additional mediaPath to an existing virtual folder, within either the default view or a user view
|
/// Adds an additional mediaPath to an existing virtual folder, within either the default view or a user view
|
||||||
|
|
Loading…
Reference in New Issue
Block a user