2012-02-07 05:08:07 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using NLog;
|
2013-02-24 19:18:48 +00:00
|
|
|
|
using NzbDrone.Core.Download;
|
2012-02-07 05:08:07 +00:00
|
|
|
|
using NzbDrone.Core.Model;
|
2013-02-19 02:19:38 +00:00
|
|
|
|
using NzbDrone.Core.Providers;
|
2012-02-07 05:08:07 +00:00
|
|
|
|
|
2013-02-19 02:19:38 +00:00
|
|
|
|
namespace NzbDrone.Core.DecisionEngine
|
2012-02-07 05:08:07 +00:00
|
|
|
|
{
|
|
|
|
|
public class AlreadyInQueueSpecification
|
|
|
|
|
{
|
|
|
|
|
private readonly DownloadProvider _downloadProvider;
|
|
|
|
|
|
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
public AlreadyInQueueSpecification(DownloadProvider downloadProvider)
|
|
|
|
|
{
|
|
|
|
|
_downloadProvider = downloadProvider;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AlreadyInQueueSpecification()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
|
|
|
|
|
{
|
|
|
|
|
return _downloadProvider.GetActiveDownloadClient().IsInQueue(subject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|