New: Monitor and Process downloads separately

New: Queue remains up to date while importing file from remote file system
Fixed: Failed downloads still in queue won't result in failed search
This commit is contained in:
Mark McDowall 2020-07-26 21:27:30 +01:00 committed by Qstick
parent a104a2911e
commit d83e20937d
40 changed files with 1119 additions and 509 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Core.Download.TrackedDownloads;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles.Releases;
@ -43,7 +44,16 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
var remoteAlbum = queueItem.RemoteAlbum;
var qualityProfile = subject.Artist.QualityProfile.Value;
// To avoid a race make sure it's not FailedPending (failed awaiting removal/search).
// Failed items (already searching for a replacement) won't be part of the queue since
// it's a copy, of the tracked download, not a reference.
if (queueItem.TrackedDownloadState == TrackedDownloadState.DownloadFailedPending)
{
continue;
}
_logger.Debug("Checking if existing release in queue meets cutoff. Queued quality is: {0}", remoteAlbum.ParsedAlbumInfo.Quality);
var queuedItemPreferredWordScore = _preferredWordServiceCalculator.Calculate(subject.Artist, queueItem.Title);
if (!_upgradableSpecification.CutoffNotMet(qualityProfile,