1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -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
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Download
_httpClient = httpClient;
_torrentFileInfoReader = torrentFileInfoReader;
}
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
public virtual bool PreferTorrentFile => false;
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Download
{
magnetUrl = torrentInfo.MagnetUrl;
}
if (PreferTorrentFile)
{
if (torrentUrl.IsNotNullOrWhiteSpace())
@@ -160,6 +160,12 @@ namespace NzbDrone.Core.Download
}
catch (HttpException ex)
{
if (ex.Response.StatusCode == HttpStatusCode.NotFound)
{
_logger.Error(ex, "Downloading torrent file for episode '{0}' failed since it no longer exists ({1})", remoteEpisode.Release.Title, torrentUrl);
throw new ReleaseUnavailableException(remoteEpisode.Release, "Downloading torrent failed", ex);
}
if ((int)ex.Response.StatusCode == 429)
{
_logger.Error("API Grab Limit reached for {0}", torrentUrl);