mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Better trace messaging for Download Decision specs
Fixed: Trace logs will contain more details when a release is rejected
This commit is contained in:
parent
2b5c512d64
commit
d648056bc4
@ -41,7 +41,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
|
||||
if (quality == Quality.Unknown)
|
||||
{
|
||||
_logger.Trace("Unknown quality. skipping size check.");
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
var qualityDefinition = _qualityDefinitionService.Get(quality);
|
||||
|
@ -37,7 +37,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
|
||||
|
||||
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 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
|
||||
|
||||
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.QualityProfile, file.Quality, subject.ParsedEpisodeInfo.Quality))
|
||||
{
|
||||
_logger.Trace("Cutoff already met, rejecting.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,12 @@ public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriter
|
||||
|
||||
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 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
|
||||
|
||||
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
|
||||
{
|
||||
_logger.Trace("Latest history item is downloading, rejecting.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
|
||||
{
|
||||
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…
Reference in New Issue
Block a user