mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fixed: Ensure indexer errors are handled before processing response
(cherry picked from commit 76f93c8415419f0c3dab90582d47a1c9a653263c)
This commit is contained in:
parent
06a214e901
commit
fe164c1def
@ -1,6 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
|
||||
namespace NzbDrone.Core.Indexers
|
||||
@ -20,6 +18,8 @@ public EzrssTorrentRssParser()
|
||||
|
||||
protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||
{
|
||||
base.PreProcess(indexerResponse);
|
||||
|
||||
var document = LoadXmlDocument(indexerResponse);
|
||||
var items = GetItems(document).ToList();
|
||||
|
||||
@ -28,7 +28,7 @@ protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||
throw new IndexerException(indexerResponse, "No results were found");
|
||||
}
|
||||
|
||||
return base.PreProcess(indexerResponse);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,11 @@ public static void CheckError(XDocument xdoc, IndexerResponse indexerResponse)
|
||||
|
||||
protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||
{
|
||||
if (indexerResponse.HttpResponse.HasHttpError)
|
||||
{
|
||||
base.PreProcess(indexerResponse);
|
||||
}
|
||||
|
||||
var xdoc = LoadXmlDocument(indexerResponse);
|
||||
|
||||
CheckError(xdoc, indexerResponse);
|
||||
|
@ -21,6 +21,11 @@ public TorznabRssParser()
|
||||
|
||||
protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||
{
|
||||
if (indexerResponse.HttpResponse.HasHttpError)
|
||||
{
|
||||
base.PreProcess(indexerResponse);
|
||||
}
|
||||
|
||||
var xdoc = LoadXmlDocument(indexerResponse);
|
||||
var error = xdoc.Descendants("error").FirstOrDefault();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user