mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-30 19:56:54 +00:00
32 lines
747 B
C#
32 lines
747 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}
|