FreeSpaceSpec will return true is free space check returns null

This commit is contained in:
Mark McDowall
2013-09-13 17:41:14 -07:00
parent 89d603d71c
commit d4096f8786
7 changed files with 34 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
{
try
{
if (_diskProvider.IsParent(localEpisode.Series.Path, localEpisode.Path))
if (localEpisode.ExistingFile)
{
_logger.Trace("Skipping free space check for existing episode");
return true;
@@ -32,6 +32,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
var path = Directory.GetParent(localEpisode.Series.Path);
var freeSpace = _diskProvider.GetAvailableSpace(path.FullName);
if (!freeSpace.HasValue)
{
_logger.Trace("Free space check returned an invalid result for: {0}", path);
return true;
}
if (freeSpace < localEpisode.Size + 100.Megabytes())
{
_logger.Warn("Not enough free space to import: {0}", localEpisode);