mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
some preliminary work to move decision engine to use the visitor pattern.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using NLog;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Model;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
{
|
||||
public class NotInQueueSpecification : IFetchableSpecification
|
||||
{
|
||||
private readonly DownloadProvider _downloadProvider;
|
||||
|
||||
|
||||
public NotInQueueSpecification(DownloadProvider downloadProvider)
|
||||
{
|
||||
_downloadProvider = downloadProvider;
|
||||
|
||||
}
|
||||
|
||||
public string RejectionReason
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Already in download queue.";
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
|
||||
{
|
||||
return !_downloadProvider.GetActiveDownloadClient().IsInQueue(subject);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user