From 5650f891ee6a7ddd0cf2352037c29228458136bb Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 16 Apr 2012 20:42:18 -0700 Subject: [PATCH] Added some additional logging around sizing. --- .../DecisionEngine/AcceptableSizeSpecification.cs | 10 +++++++++- NzbDrone.Core/Providers/Indexer/IndexerBase.cs | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs b/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs index 2c5d5bdcd..8777ef153 100644 --- a/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs +++ b/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs @@ -25,6 +25,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine public virtual bool IsSatisfiedBy(EpisodeParseResult subject) { + logger.Trace("Beginning size check for: {0}", subject); var qualityType = _qualityTypeProvider.Get((int)subject.Quality.QualityType); //Need to determine if this is a 30 or 60 minute episode @@ -33,7 +34,10 @@ namespace NzbDrone.Core.Providers.DecisionEngine //0 will be treated as unlimited if (qualityType.MaxSize == 0) + { + logger.Trace("Max size is 0 (unlimited) - skipping check."); return true; + } var maxSize = qualityType.MaxSize.Megabytes(); var series = subject.Series; @@ -57,8 +61,12 @@ namespace NzbDrone.Core.Providers.DecisionEngine //If the parsed size is greater than maxSize we don't want it if (subject.Size > maxSize) + { + logger.Trace("Item: {0}, Size: {1} is greater than maximum allowed size ({1}), rejecting.", subject, subject.Size, maxSize); return false; - + } + + logger.Trace("Item: {0}, meets size contraints.", subject); return true; } diff --git a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs index 092973c86..efda27500 100644 --- a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs +++ b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs @@ -239,6 +239,8 @@ namespace NzbDrone.Core.Providers.Indexer var episodeParseResult = Parser.ParseTitle(title); if (episodeParseResult != null) episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days; + _logger.Trace("Parsed: {0} from: {1}", episodeParseResult, item.Title.Text); + return CustomParser(item, episodeParseResult); }