mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
improve smb support
This commit is contained in:
parent
53024bd149
commit
696a6b34ea
80 changed files with 256 additions and 151 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue