mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
31 lines
781 B
C#
31 lines
781 B
C#
using NLog;
|
|
using NzbDrone.Core.Download;
|
|
using NzbDrone.Core.Model;
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
{
|
|
public class NotInQueueSpecification : IFetchableSpecification
|
|
{
|
|
private readonly IProvideDownloadClient _downloadClientProvider;
|
|
|
|
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
|
|
{
|
|
_downloadClientProvider = downloadClientProvider;
|
|
}
|
|
|
|
public string RejectionReason
|
|
{
|
|
get
|
|
{
|
|
return "Already in download queue.";
|
|
}
|
|
}
|
|
|
|
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
|
|
{
|
|
return !_downloadClientProvider.GetDownloadClient().IsInQueue(subject);
|
|
}
|
|
|
|
}
|
|
}
|