mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
commit
a623dd1921
1 changed files with 4 additions and 6 deletions
|
@ -647,7 +647,6 @@ namespace Emby.Server.Implementations.IO
|
||||||
public virtual bool IsPathFile(string path)
|
public virtual bool IsPathFile(string path)
|
||||||
{
|
{
|
||||||
// Cannot use Path.IsPathRooted because it returns false under mono when using windows-based paths, e.g. C:\\
|
// Cannot use Path.IsPathRooted because it returns false under mono when using windows-based paths, e.g. C:\\
|
||||||
|
|
||||||
if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) != -1 &&
|
if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) != -1 &&
|
||||||
!path.StartsWith("file://", StringComparison.OrdinalIgnoreCase))
|
!path.StartsWith("file://", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -655,8 +654,6 @@ namespace Emby.Server.Implementations.IO
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//return Path.IsPathRooted(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void DeleteFile(string path)
|
public virtual void DeleteFile(string path)
|
||||||
|
@ -667,13 +664,14 @@ namespace Emby.Server.Implementations.IO
|
||||||
|
|
||||||
public virtual List<FileSystemMetadata> GetDrives()
|
public virtual List<FileSystemMetadata> GetDrives()
|
||||||
{
|
{
|
||||||
// Only include drives in the ready state or this method could end up being very slow, waiting for drives to timeout
|
// check for ready state to avoid waiting for drives to timeout
|
||||||
return DriveInfo.GetDrives().Where(d => d.IsReady).Select(d => new FileSystemMetadata
|
// some drives on linux have no actual size or are used for other purposes
|
||||||
|
return DriveInfo.GetDrives().Where(d => d.IsReady && d.TotalSize != 0 && d.DriveType != DriveType.Ram)
|
||||||
|
.Select(d => new FileSystemMetadata
|
||||||
{
|
{
|
||||||
Name = d.Name,
|
Name = d.Name,
|
||||||
FullName = d.RootDirectory.FullName,
|
FullName = d.RootDirectory.FullName,
|
||||||
IsDirectory = true
|
IsDirectory = true
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue