mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
FreeSpaceSpec will return true is free space check returns null
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
||||
|
||||
public bool IsSatisfiedBy(LocalEpisode localEpisode)
|
||||
{
|
||||
if (_diskProvider.IsParent(localEpisode.Series.Path, localEpisode.Path))
|
||||
if (localEpisode.ExistingFile)
|
||||
{
|
||||
_logger.Trace("{0} is in series folder, skipping in use check", localEpisode.Path);
|
||||
return true;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
||||
|
||||
public bool IsSatisfiedBy(LocalEpisode localEpisode)
|
||||
{
|
||||
if (_diskProvider.IsParent(localEpisode.Series.Path, localEpisode.Path))
|
||||
if (localEpisode.ExistingFile)
|
||||
{
|
||||
_logger.Trace("{0} is in series folder, unpacking check", localEpisode.Path);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user