mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-20 21:54:58 -04:00
Fixed: Ignore free space check before grabbing if directory is missing
Closes #7273
This commit is contained in:
committed by
Mark McDowall
parent
c8f419b014
commit
354ed96572
@@ -1,3 +1,4 @@
|
||||
using System.IO;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
@@ -32,11 +33,21 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
}
|
||||
|
||||
var size = subject.Release.Size;
|
||||
var freeSpace = _diskProvider.GetAvailableSpace(subject.Series.Path);
|
||||
var path = subject.Series.Path;
|
||||
long? freeSpace = null;
|
||||
|
||||
try
|
||||
{
|
||||
freeSpace = _diskProvider.GetAvailableSpace(path);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// Ignore so it'll be skipped in the following checks
|
||||
}
|
||||
|
||||
if (!freeSpace.HasValue)
|
||||
{
|
||||
_logger.Debug("Unable to get available space for {0}. Skipping", subject.Series.Path);
|
||||
_logger.Debug("Unable to get available space for {0}. Skipping", path);
|
||||
|
||||
return Decision.Accept();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user