Fixed: EZTV logging generic error when there were no results

This commit is contained in:
Mark McDowall
2014-12-03 17:22:14 -08:00
parent 0cc4639e65
commit 29ee0ef2be
6 changed files with 48 additions and 29 deletions
+19 -20
View File
@@ -7,7 +7,6 @@ using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.Indexers.Exceptions;
@@ -195,6 +194,25 @@ namespace NzbDrone.Core.Indexers
return 0;
}
protected IEnumerable<XElement> GetItems(XDocument document)
{
var root = document.Root;
if (root == null)
{
return Enumerable.Empty<XElement>();
}
var channel = root.Element("channel");
if (channel == null)
{
return Enumerable.Empty<XElement>();
}
return channel.Elements("item");
}
private static readonly Regex ParseSizeRegex = new Regex(@"(?<value>\d+\.\d{1,2}|\d+\,\d+\.\d{1,2}|\d+)\W?(?<unit>[KMG]i?B)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
@@ -237,24 +255,5 @@ namespace NzbDrone.Core.Indexers
return Convert.ToInt64(result);
}
private IEnumerable<XElement> GetItems(XDocument document)
{
var root = document.Root;
if (root == null)
{
return Enumerable.Empty<XElement>();
}
var channel = root.Element("channel");
if (channel == null)
{
return Enumerable.Empty<XElement>();
}
return channel.Elements("item");
}
}
}