Added option to disable blacklisting, both the queue check and the spec

This commit is contained in:
Mark McDowall
2013-10-28 17:41:35 -07:00
parent 4578adf1c0
commit 7c6fad155a
7 changed files with 84 additions and 22 deletions
@@ -1,6 +1,7 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
@@ -9,11 +10,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public class BlacklistSpecification : IDecisionEngineSpecification
{
private readonly IBlacklistService _blacklistService;
private readonly IConfigService _configService;
private readonly Logger _logger;
public BlacklistSpecification(IBlacklistService blacklistService, Logger logger)
public BlacklistSpecification(IBlacklistService blacklistService, IConfigService configService, Logger logger)
{
_blacklistService = blacklistService;
_configService = configService;
_logger = logger;
}
@@ -27,9 +30,15 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
{
if (!_configService.EnableFailedDownloadHandling)
{
_logger.Trace("Failed Download Handling is not enabled");
return true;
}
if (_blacklistService.Blacklisted(subject.Release.Title))
{
_logger.Trace("Release is blacklisted");
_logger.Trace("{0} is blacklisted", subject.Release.Title);
return false;
}