mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
Added option to disable blacklisting, both the queue check and the spec
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user