1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs

31 lines
786 B
C#
Raw Normal View History

using NLog;
using NzbDrone.Core.Download;
using NzbDrone.Core.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
2013-04-07 10:30:37 +03:00
public class NotInQueueSpecification : IDecisionEngineSpecification
{
2013-04-01 09:22:16 +03:00
private readonly IProvideDownloadClient _downloadClientProvider;
2013-04-01 09:22:16 +03:00
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
{
2013-04-01 09:22:16 +03:00
_downloadClientProvider = downloadClientProvider;
}
public string RejectionReason
{
get
{
return "Already in download queue.";
}
}
public virtual bool IsSatisfiedBy(IndexerParseResult subject)
{
2013-04-01 09:22:16 +03:00
return !_downloadClientProvider.GetDownloadClient().IsInQueue(subject);
}
}
}