From bd4bd47e4e7721b67a050c3ffa186fd693704a87 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 19 Aug 2013 08:19:39 -0700 Subject: [PATCH] Added more logging when free disk space check fails on import --- .../Specifications/FreeSpaceSpecification.cs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs b/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs index b9a7bd717..9f2b468b7 100644 --- a/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs +++ b/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using System.Linq; using NLog; using NzbDrone.Common; @@ -22,16 +23,24 @@ public FreeSpaceSpecification(IDiskProvider diskProvider, Logger logger) public bool IsSatisfiedBy(LocalEpisode localEpisode) { - var path = Directory.GetParent(localEpisode.Series.Path); - var freeSpace = _diskProvider.GetAvilableSpace(path.FullName); - - if (freeSpace < localEpisode.Size + 100.Megabytes()) + try { - _logger.Warn("Not enough free space to import: {0}", localEpisode); - return false; - } + var path = Directory.GetParent(localEpisode.Series.Path); + var freeSpace = _diskProvider.GetAvilableSpace(path.FullName); - return true; + if (freeSpace < localEpisode.Size + 100.Megabytes()) + { + _logger.Warn("Not enough free space to import: {0}", localEpisode); + return false; + } + + return true; + } + catch (Exception ex) + { + _logger.ErrorException("Unable to check free disk space while importing: " + localEpisode.Path, ex); + throw; + } } } }