mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 00:35:26 +03:00
improve smb support
This commit is contained in:
@@ -30,6 +30,34 @@ namespace Emby.Common.Implementations.IO
|
||||
return path.StartsWith("smb://", StringComparison.OrdinalIgnoreCase) || IsUncPath(path);
|
||||
}
|
||||
|
||||
public string NormalizePath(string path)
|
||||
{
|
||||
if (path.StartsWith("smb://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
if (IsUncPath(path))
|
||||
{
|
||||
return ConvertUncToSmb(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public string GetDirectoryName(string path)
|
||||
{
|
||||
var separator = GetDirectorySeparatorChar(path);
|
||||
var result = Path.GetDirectoryName(path);
|
||||
|
||||
if (separator == '/')
|
||||
{
|
||||
result = result.Replace('\\', '/');
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public char GetDirectorySeparatorChar(string path)
|
||||
{
|
||||
if (path.IndexOf('/') != -1)
|
||||
|
||||
Reference in New Issue
Block a user