From 0aa3da97805c7a0a706d95926223fa3e5490ec46 Mon Sep 17 00:00:00 2001 From: Qstick Date: Tue, 10 Sep 2019 23:54:16 -0400 Subject: [PATCH] Fixed: Minor Cleanup Co-Authored-By: Mark McDowall --- .../Specifications/QueueSpecification.cs | 7 +++---- .../Specifications/RssSync/HistorySpecification.cs | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs index 640b5870f..4ffda3d90 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs @@ -33,10 +33,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications public Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria) { var queue = _queueService.GetQueue(); - var matchingAlbum = queue.Where(q => q.RemoteAlbum != null && - q.RemoteAlbum.Artist != null && - q.RemoteAlbum.Artist.Id == subject.Artist.Id && - q.RemoteAlbum.Albums.Select(e => e.Id).Intersect(subject.Albums.Select(e => e.Id)).Any()) + var matchingAlbum = queue.Where(q => q.RemoteAlbum?.Artist != null && + q.RemoteAlbum.Artist.Id == subject.Artist.Id && + q.RemoteAlbum.Albums.Select(e => e.Id).Intersect(subject.Albums.Select(e => e.Id)).Any()) .ToList(); diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs index 276b70ecb..65cac72f3 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs @@ -54,6 +54,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed) { var recent = mostRecent.Date.After(DateTime.UtcNow.AddHours(-12)); + + if (!recent && cdhEnabled) + { + continue; + } + // The artist will be the same as the one in history since it's the same album. // Instead of fetching the artist from the DB reuse the known artist. var preferredWordScore = _preferredWordServiceCalculator.Calculate(subject.Artist, mostRecent.SourceTitle); @@ -72,11 +78,6 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync subject.ParsedAlbumInfo.Quality, subject.PreferredWordScore); - if (!recent && cdhEnabled) - { - continue; - } - if (!cutoffUnmet) { if (recent)