diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-09-13 17:30:50 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-09-13 17:30:50 +0200 |
| commit | 767a42fbdbbb2db30313d0935f322f162ebeced4 (patch) | |
| tree | 91b187902579eac2fd25d731310f729e9803c148 /Emby.Server.Implementations/IO/ManagedFileSystem.cs | |
| parent | 3f19befc594670d72c2611f103e703633960e0aa (diff) | |
Minor LibraryMonitor improvements
* Enable nullable
* Add a fast return to ReportFileSystemChanged when path should be ignored
* Use Span overloads of Path.* functions where possible
* IFileSystem: remove NormalizePath as Path.TrimEndingDirectorySeparator already checks if it's a root path
Diffstat (limited to 'Emby.Server.Implementations/IO/ManagedFileSystem.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/ManagedFileSystem.cs | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 0ba4a488b..3aa5233ed 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -486,24 +486,10 @@ namespace Emby.Server.Implementations.IO } /// <inheritdoc /> - public virtual string NormalizePath(string path) - { - ArgumentException.ThrowIfNullOrEmpty(path); - - if (path.EndsWith(":\\", StringComparison.OrdinalIgnoreCase)) - { - return path; - } - - return Path.TrimEndingDirectorySeparator(path); - } - - /// <inheritdoc /> public virtual bool AreEqual(string path1, string path2) { - return string.Equals( - NormalizePath(path1), - NormalizePath(path2), + return Path.TrimEndingDirectorySeparator(path1).Equals( + Path.TrimEndingDirectorySeparator(path2), _isEnvironmentCaseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal); } |
