The Free Software Media System - Server Backend & API
Remove ManagedFileSystem.IsRootPath
Bond_009c533b204961b
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.csindex c0e757543d..679795dd2c 100644--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs@@ -55,7 +55,7 @@ namespace Emby.Server.Implementations.IO}var extension = Path.GetExtension(filename);- return _shortcutHandlers.Any(i => string.Equals(extension, i.Extension, StringComparison.OrdinalIgnoreCase));+ return _shortcutHandlers.Any(i => string.Equals(extension, i.Extension, _isEnvironmentCaseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal));}/// <summary>@@ -487,26 +487,9 @@ namespace Emby.Server.Implementations.IOthrow new ArgumentNullException(nameof(path));}- var separatorChar = Path.DirectorySeparatorChar;-- return path.IndexOf(parentPath.TrimEnd(separatorChar) + separatorChar, StringComparison.OrdinalIgnoreCase) != -1;- }-- public virtual bool IsRootPath(string path)- {- if (string.IsNullOrEmpty(path))- {- throw new ArgumentNullException(nameof(path));- }-- var parent = Path.GetDirectoryName(path);-- if (!string.IsNullOrEmpty(parent))- {- return false;- }-- return true;+ return path.Contains(+ Path.TrimEndingDirectorySeparator(parentPath) + Path.DirectorySeparatorChar,+ _isEnvironmentCaseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);}public virtual string NormalizePath(string path)@@ -521,7 +504,7 @@ namespace Emby.Server.Implementations.IOreturn path;}- return path.TrimEnd(Path.DirectorySeparatorChar);+ return Path.TrimEndingDirectorySeparator(path);}public virtual bool AreEqual(string path1, string path2)@@ -536,7 +519,10 @@ namespace Emby.Server.Implementations.IOreturn false;}- return string.Equals(NormalizePath(path1), NormalizePath(path2), StringComparison.OrdinalIgnoreCase);+ return string.Equals(+ NormalizePath(path1),+ NormalizePath(path2),+ _isEnvironmentCaseInsensitive ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);}public virtual string GetFileNameWithoutExtension(FileSystemMetadata info)diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.csindex ef08ecec66..e5c26430a8 100644--- a/MediaBrowser.Model/IO/IFileSystem.cs+++ b/MediaBrowser.Model/IO/IFileSystem.cs@@ -117,13 +117,6 @@ namespace MediaBrowser.Model.IO/// <returns><c>true</c> if [contains sub path] [the specified parent path]; otherwise, <c>false</c>.</returns>bool ContainsSubPath(string parentPath, string path);- /// <summary>- /// Determines whether [is root path] [the specified path].- /// </summary>- /// <param name="path">The path.</param>- /// <returns><c>true</c> if [is root path] [the specified path]; otherwise, <c>false</c>.</returns>- bool IsRootPath(string path);-/// <summary>/// Normalizes the path./// </summary>