1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Blacklisting will trigger episode search

This commit is contained in:
Mark McDowall
2013-10-23 22:13:04 -07:00
parent 68e40bca29
commit 8520fe3e0c
12 changed files with 197 additions and 48 deletions
@@ -3,18 +3,19 @@ using NzbDrone.Core.Download;
using NzbDrone.Core.Download.Clients.Sabnzbd;
using NzbDrone.Core.History;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.MetadataSource.Trakt;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
{
public class UpgradeHistorySpecification : IDecisionEngineSpecification
public class HistorySpecification : IDecisionEngineSpecification
{
private readonly IHistoryService _historyService;
private readonly QualityUpgradableSpecification _qualityUpgradableSpecification;
private readonly IProvideDownloadClient _downloadClientProvider;
private readonly Logger _logger;
public UpgradeHistorySpecification(IHistoryService historyService,
public HistorySpecification(IHistoryService historyService,
QualityUpgradableSpecification qualityUpgradableSpecification,
IProvideDownloadClient downloadClientProvider,
Logger logger)
@@ -43,7 +44,17 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
if (_downloadClientProvider.GetDownloadClient().GetType() == typeof (SabnzbdClient))
{
_logger.Trace("Skipping history check in favour of blacklist");
_logger.Trace("Performing history status check on report");
foreach (var episode in subject.Episodes)
{
_logger.Trace("Checking current status of episode [{0}] in history", episode.Id);
var mostRecent = _historyService.MostRecentForEpisode(episode.Id);
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
{
return false;
}
}
return true;
}