1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-18 20:59:02 +00:00
Lidarr/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs

30 lines
786 B
C#

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