|
|
@ -303,25 +303,23 @@ namespace NzbDrone.Common
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var drives = DriveInfo.GetDrives();
|
|
|
|
var drives = DriveInfo.GetDrives();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var drive in drives)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (drive.IsReady && path.StartsWith(drive.Name, StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
return
|
|
|
|
{
|
|
|
|
drives.Where(drive =>
|
|
|
|
return drive.AvailableFreeSpace;
|
|
|
|
drive.IsReady && path.StartsWith(drive.Name, StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
}
|
|
|
|
.OrderByDescending(drive => drive.Name.Length)
|
|
|
|
|
|
|
|
.First()
|
|
|
|
|
|
|
|
.AvailableFreeSpace;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (InvalidOperationException e)
|
|
|
|
catch (InvalidOperationException e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Logger.ErrorException("Couldn't get free space for " + path, e);
|
|
|
|
Logger.ErrorException("Couldn't get free space for " + path, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DriveFreeSpaceEx(root);
|
|
|
|
return DriveFreeSpaceEx(root);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|