mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-17 21:26:22 -04:00
skip queue check and adding new items if download client isn't configured correctly.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Tv;
|
||||
@@ -10,10 +11,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
public class NotInQueueSpecification : IDecisionEngineSpecification
|
||||
{
|
||||
private readonly IProvideDownloadClient _downloadClientProvider;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
|
||||
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider, Logger logger)
|
||||
{
|
||||
_downloadClientProvider = downloadClientProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public string RejectionReason
|
||||
@@ -28,6 +31,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
{
|
||||
var downloadClient = _downloadClientProvider.GetDownloadClient();
|
||||
|
||||
if (!downloadClient.IsConfigured)
|
||||
{
|
||||
_logger.Warn("Download client {0} isn't configured yet.", downloadClient.GetType().Name);
|
||||
return true;
|
||||
}
|
||||
|
||||
var queue = downloadClient.GetQueue().Select(queueItem => Parser.Parser.ParseTitle(queueItem.Title)).Where(episodeInfo => episodeInfo != null);
|
||||
|
||||
return !IsInQueue(subject, queue);
|
||||
|
||||
Reference in New Issue
Block a user