some preliminary work to move decision engine to use the visitor pattern.

This commit is contained in:
kay.one 2013-03-06 16:19:49 -08:00
parent 969dff5197
commit 02d842a2b2
51 changed files with 470 additions and 507 deletions

View file

@ -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);
}
}
}