From c0542449a4e470db120458008e42196dd744e42e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 22 Jan 2012 13:16:25 -0800 Subject: [PATCH] Added additional logging to episode searching. --- NzbDrone.Core.Test/ParserTest.cs | 1 + NzbDrone.Core/Providers/DownloadProvider.cs | 2 ++ NzbDrone.Core/Providers/InventoryProvider.cs | 3 +++ NzbDrone.Core/Providers/SearchProvider.cs | 12 ++++++++++++ 4 files changed, 18 insertions(+) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index c628725e4..112c5b520 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -137,6 +137,7 @@ namespace NzbDrone.Core.Test [TestCase("WEEDS.S03E01-06.DUAL.XviD.Bluray.AC3.-HELLYWOOD.avi", QualityTypes.DVD)] [TestCase("WEEDS.S03E01-06.DUAL.Bluray.AC3.-HELLYWOOD.avi", QualityTypes.Bluray720p)] [TestCase("The Voice S01E11 The Finals 1080i HDTV DD5.1 MPEG2-TrollHD", QualityTypes.Unknown)] + [TestCase("Nikita S02E01 HDTV XviD 2HD", QualityTypes.SDTV)] public void quality_parse(string postTitle, object quality) { var result = Parser.ParseQuality(postTitle); diff --git a/NzbDrone.Core/Providers/DownloadProvider.cs b/NzbDrone.Core/Providers/DownloadProvider.cs index bbc85efc2..3a1b580e6 100644 --- a/NzbDrone.Core/Providers/DownloadProvider.cs +++ b/NzbDrone.Core/Providers/DownloadProvider.cs @@ -42,6 +42,8 @@ namespace NzbDrone.Core.Providers if (addSuccess) { + Logger.Trace("Download added to Queue: {0}", sabTitle); + foreach (var episode in _episodeProvider.GetEpisodesByParseResult(parseResult)) { var history = new History(); diff --git a/NzbDrone.Core/Providers/InventoryProvider.cs b/NzbDrone.Core/Providers/InventoryProvider.cs index c2cf90f8c..73a13c1d3 100644 --- a/NzbDrone.Core/Providers/InventoryProvider.cs +++ b/NzbDrone.Core/Providers/InventoryProvider.cs @@ -87,7 +87,10 @@ namespace NzbDrone.Core.Providers var cutoff = parsedReport.Series.QualityProfile.Cutoff; if (!IsAcceptableSize(parsedReport)) + { + Logger.Trace("Size: {0} is not acceptable for Quality: {1}", parsedReport.Size, parsedReport.Q); return false; + } foreach (var episode in _episodeProvider.GetEpisodesByParseResult(parsedReport, true)) { diff --git a/NzbDrone.Core/Providers/SearchProvider.cs b/NzbDrone.Core/Providers/SearchProvider.cs index 57c8aee07..c60693365 100644 --- a/NzbDrone.Core/Providers/SearchProvider.cs +++ b/NzbDrone.Core/Providers/SearchProvider.cs @@ -229,19 +229,31 @@ namespace NzbDrone.Core.Providers //If series is null or doesn't match the series we're looking for return if (episodeParseResult.Series == null || episodeParseResult.Series.SeriesId != series.SeriesId) + { + Logger.Trace("Unexpected series for search: {0}. Skipping.", episodeParseResult.CleanTitle); continue; + } //If SeasonNumber doesn't match or episode is not in the in the list in the parse result, skip the report. if (episodeParseResult.SeasonNumber != seasonNumber) + { + Logger.Trace("Season number does not match searched season number, skipping."); continue; + } //If the EpisodeNumber was passed in and it is not contained in the parseResult, skip the report. if (episodeNumber.HasValue && !episodeParseResult.EpisodeNumbers.Contains(episodeNumber.Value)) + { + Logger.Trace("Searched episode number is not contained in post, skipping."); continue; + } //Make sure we haven't already downloaded a report with this episodenumber, if we have, skip the report. if (successes.Intersect(episodeParseResult.EpisodeNumbers).Count() > 0) + { + Logger.Trace("Episode has already been downloaded in this search, skipping."); continue; + } if (_inventoryProvider.IsQualityNeeded(episodeParseResult, true)) {