From ef42034e38afc16fbae86cc29337571931e5cdb4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 11 Jul 2013 17:07:21 -0700 Subject: [PATCH] Free disk space should be faster on drive pools --- NzbDrone.Common/DiskProvider.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Common/DiskProvider.cs b/NzbDrone.Common/DiskProvider.cs index 0527a6d0d..ac028ef01 100644 --- a/NzbDrone.Common/DiskProvider.cs +++ b/NzbDrone.Common/DiskProvider.cs @@ -264,19 +264,19 @@ namespace NzbDrone.Common 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)