1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Download decision rejection reasons are no longer static messages

New: Better messaging on manual search when release is rejected
This commit is contained in:
Mark McDowall
2014-10-26 22:51:50 -07:00
parent e82b29e346
commit 95d67ef9f4
41 changed files with 265 additions and 378 deletions
@@ -19,17 +19,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
_logger = logger;
}
public string RejectionReason
{
get
{
return "Already in download queue.";
}
}
public RejectionType Type { get { return RejectionType.Permanent; } }
public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
{
var queue = _downloadTrackingService.GetQueuedDownloads()
.Where(v => v.State == TrackedDownloadState.Downloading)
@@ -38,10 +30,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
if (IsInQueue(subject, queue))
{
_logger.Debug("Already in queue, rejecting.");
return false;
return Decision.Reject("Already in download queue");
}
return true;
return Decision.Accept();
}
private bool IsInQueue(RemoteEpisode newEpisode, IEnumerable<RemoteEpisode> queue)