Better trace messaging for Download Decision specs

Fixed: Trace logs will contain more details when a release is rejected
pull/4/head
Mark McDowall 11 years ago
parent 2b5c512d64
commit d648056bc4

@ -41,7 +41,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
if (quality == Quality.Unknown)
{
_logger.Trace("Unknown quality. skipping size check.");
return false;
return true;
}
var qualityDefinition = _qualityDefinitionService.Get(quality);

@ -37,7 +37,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
if (_blacklistService.Blacklisted(subject.Release.Title))
{
_logger.Trace("{0} is blacklisted", subject.Release.Title);
_logger.Trace("{0} is blacklisted, rejecting.", subject.Release.Title);
return false;
}

@ -33,6 +33,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.QualityProfile, file.Quality, subject.ParsedEpisodeInfo.Quality))
{
_logger.Trace("Cutoff already met, rejecting.");
return false;
}
}

@ -40,7 +40,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
var queue = downloadClient.GetQueue().Select(q => q.RemoteEpisode);
return !IsInQueue(subject, queue);
if (IsInQueue(subject, queue))
{
_logger.Trace("Already in queue, rejecting.");
}
return true;
}
private bool IsInQueue(RemoteEpisode newEpisode, IEnumerable<RemoteEpisode> queue)

@ -1,16 +1,24 @@
using NzbDrone.Core.IndexerSearch.Definitions;
using NLog;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class NotSampleSpecification : IDecisionEngineSpecification
{
private readonly Logger _logger;
public string RejectionReason { get { return "Sample"; } }
public NotSampleSpecification(Logger logger)
{
_logger = logger;
}
public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
{
if (subject.Release.Title.ToLower().Contains("sample") && subject.Release.Size < 70.Megabytes())
{
_logger.Trace("Sample release, rejecting.");
return false;
}

@ -51,6 +51,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
{
_logger.Trace("Latest history item is downloading, rejecting.");
return false;
}
}

@ -41,7 +41,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
{
if (file.DateAdded < DateTime.Today.AddDays(-7))
{
_logger.Trace("Proper for old file, skipping: {0}", subject);
_logger.Trace("Proper for old file, rejecting: {0}", subject);
return false;
}

Loading…
Cancel
Save