|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|