mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
Free disk space should be faster on drive pools
This commit is contained in:
parent
f6ec58ecd5
commit
ef42034e38
@ -264,19 +264,19 @@ public virtual long GetAvilableSpace(string path)
|
||||
throw new DirectoryNotFoundException(path);
|
||||
|
||||
|
||||
var driveInfo = DriveInfo.GetDrives().SingleOrDefault(c => c.IsReady && c.Name.Equals(Path.GetPathRoot(path), StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
if (driveInfo == null)
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
var driveInfo = DriveInfo.GetDrives().SingleOrDefault(c => c.IsReady && c.Name.Equals(Path.GetPathRoot(path), StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
if (driveInfo == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DriveFreeSpaceEx(path);
|
||||
return driveInfo.AvailableFreeSpace;
|
||||
}
|
||||
|
||||
return driveInfo.AvailableFreeSpace;
|
||||
return DriveFreeSpaceEx(path);
|
||||
}
|
||||
|
||||
private static long DriveFreeSpaceEx(string folderName)
|
||||
|
Loading…
Reference in New Issue
Block a user