mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
New: Watch filesystem for changes to library
This commit is contained in:
@@ -32,19 +32,23 @@ namespace NzbDrone.Common.Extensions
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
var info = new FileInfo(path.Trim());
|
||||
return info.FullName.CleanFilePathBasic();
|
||||
}
|
||||
|
||||
public static string CleanFilePathBasic(this string path)
|
||||
{
|
||||
//UNC
|
||||
if (OsInfo.IsWindows && info.FullName.StartsWith(@"\\"))
|
||||
if (OsInfo.IsWindows && path.StartsWith(@"\\"))
|
||||
{
|
||||
return info.FullName.TrimEnd('/', '\\', ' ');
|
||||
return path.TrimEnd('/', '\\', ' ');
|
||||
}
|
||||
|
||||
if (OsInfo.IsNotWindows && info.FullName.TrimEnd('/').Length == 0)
|
||||
if (OsInfo.IsNotWindows && path.TrimEnd('/').Length == 0)
|
||||
{
|
||||
return "/";
|
||||
}
|
||||
|
||||
return info.FullName.TrimEnd('/').Trim('\\', ' ');
|
||||
return path.TrimEnd('/').Trim('\\', ' ');
|
||||
}
|
||||
|
||||
public static bool PathNotEquals(this string firstPath, string secondPath, StringComparison? comparison = null)
|
||||
|
||||
Reference in New Issue
Block a user