aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/IO/ManagedFileSystem.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-02 00:45:57 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-02 00:45:57 -0400
commit4a8960fc866143e7107a5bc41527db6c5581974f (patch)
tree47077506324da6137d56e322299942ee6eeb9512 /Emby.Common.Implementations/IO/ManagedFileSystem.cs
parent6e4d2342120c4bde4fdc99bc17dea0aec7b75ced (diff)
3.2.10.4
Diffstat (limited to 'Emby.Common.Implementations/IO/ManagedFileSystem.cs')
-rw-r--r--Emby.Common.Implementations/IO/ManagedFileSystem.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Common.Implementations/IO/ManagedFileSystem.cs b/Emby.Common.Implementations/IO/ManagedFileSystem.cs
index d1903851f..ba73c1ba2 100644
--- a/Emby.Common.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Common.Implementations/IO/ManagedFileSystem.cs
@@ -536,14 +536,14 @@ namespace Emby.Common.Implementations.IO
CopyFile(temp1, file2, true);
}
- private char GetSeparatorChar(string path)
+ private char GetDirectorySeparatorChar(string path)
{
- if (path.IndexOf('/') != -1)
+ if (_sharpCifsFileSystem.IsEnabledForPath(path))
{
- return '/';
+ return _sharpCifsFileSystem.GetDirectorySeparatorChar(path);
}
- return '\\';
+ return Path.DirectorySeparatorChar;
}
public bool AreEqual(string path1, string path2)
@@ -558,8 +558,8 @@ namespace Emby.Common.Implementations.IO
return false;
}
- path1 = path1.TrimEnd(GetSeparatorChar(path1));
- path2 = path2.TrimEnd(GetSeparatorChar(path2));
+ path1 = path1.TrimEnd(GetDirectorySeparatorChar(path1));
+ path2 = path2.TrimEnd(GetDirectorySeparatorChar(path2));
return string.Equals(path1, path2, StringComparison.OrdinalIgnoreCase);
}
@@ -576,7 +576,7 @@ namespace Emby.Common.Implementations.IO
throw new ArgumentNullException("path");
}
- var separatorChar = GetSeparatorChar(parentPath);
+ var separatorChar = GetDirectorySeparatorChar(parentPath);
return path.IndexOf(parentPath.TrimEnd(separatorChar) + separatorChar, StringComparison.OrdinalIgnoreCase) != -1;
}
@@ -610,7 +610,7 @@ namespace Emby.Common.Implementations.IO
return path;
}
- return path.TrimEnd(GetSeparatorChar(path));
+ return path.TrimEnd(GetDirectorySeparatorChar(path));
}
public string GetFileNameWithoutExtension(FileSystemMetadata info)