mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
Fixed: EZTV logging generic error when there were no results
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
|
||||
namespace NzbDrone.Core.Indexers
|
||||
{
|
||||
@@ -14,6 +17,22 @@ namespace NzbDrone.Core.Indexers
|
||||
UseEnclosureUrl = true;
|
||||
}
|
||||
|
||||
protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||
{
|
||||
using (var xmlTextReader = XmlReader.Create(new StringReader(indexerResponse.Content), new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore, IgnoreComments = true }))
|
||||
{
|
||||
var document = XDocument.Load(xmlTextReader);
|
||||
var items = GetItems(document).ToList();
|
||||
|
||||
if (items.Count == 1 && GetTitle(items.First()).Equals("No items exist - Try again later"))
|
||||
{
|
||||
throw new IndexerException(indexerResponse, "No results were found");
|
||||
}
|
||||
}
|
||||
|
||||
return base.PreProcess(indexerResponse);
|
||||
}
|
||||
|
||||
protected override Int64 GetSize(XElement item)
|
||||
{
|
||||
var contentLength = item.FindDecendants("contentLength").SingleOrDefault();
|
||||
|
||||
Reference in New Issue
Block a user