You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs

31 lines
786 B

using NLog;
using NzbDrone.Core.Download;
using NzbDrone.Core.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class NotInQueueSpecification : IDecisionEngineSpecification
{
12 years ago
private readonly IProvideDownloadClient _downloadClientProvider;
12 years ago
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
{
12 years ago
_downloadClientProvider = downloadClientProvider;
}
public string RejectionReason
{
get
{
return "Already in download queue.";
}
}
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
12 years ago
return !_downloadClientProvider.GetDownloadClient().IsInQueue(subject);
}
}
}