mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 16:33:25 -03:00
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
This commit is contained in:
@@ -485,25 +485,11 @@ namespace Emby.Server.Implementations.IO
|
||||
_isEnvironmentCaseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user