1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Fixed: Releases no longer available on the indexer should be removed from the pending queue.

fixes #679
This commit is contained in:
Taloth Saldono
2017-08-12 09:40:15 +02:00
parent b7e74bd5be
commit 20af2c8c0f
9 changed files with 96 additions and 6 deletions
@@ -6,6 +6,7 @@ using NLog;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download.Clients;
using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Core.Download
@@ -40,6 +41,7 @@ namespace NzbDrone.Core.Download
var grabbed = new List<DownloadDecision>();
var pending = new List<DownloadDecision>();
var failed = new List<DownloadDecision>();
var rejected = decisions.Where(d => d.Rejected).ToList();
var usenetFailed = false;
var torrentFailed = false;
@@ -74,6 +76,11 @@ namespace NzbDrone.Core.Download
_downloadService.DownloadReport(remoteEpisode);
grabbed.Add(report);
}
catch (ReleaseUnavailableException)
{
_logger.Warn("Failed to download release from indexer, no longer available. " + remoteEpisode);
rejected.Add(report);
}
catch (Exception ex)
{
if (ex is DownloadClientUnavailableException || ex is DownloadClientAuthenticationException)
@@ -99,7 +106,7 @@ namespace NzbDrone.Core.Download
pending.AddRange(ProcessFailedGrabs(grabbed, failed));
return new ProcessedDecisions(grabbed, pending, decisions.Where(d => d.Rejected).ToList());
return new ProcessedDecisions(grabbed, pending, rejected);
}
internal List<DownloadDecision> GetQualifiedReports(IEnumerable<DownloadDecision> decisions)