mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
Fixed: Issue parsing size from newznab mocking indexers
This commit is contained in:
parent
ac18d6c704
commit
174689f533
2 changed files with 3 additions and 7 deletions
|
@ -17,12 +17,12 @@ namespace NzbDrone.Core.Indexers.Newznab
|
|||
var attributes = item.Elements("attr").ToList();
|
||||
var sizeElement = attributes.SingleOrDefault(e => e.Attribute("name").Value.Equals("size", StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
if (sizeElement == null)
|
||||
if (sizeElement != null)
|
||||
{
|
||||
|
||||
return Convert.ToInt64(sizeElement.Attribute("value").Value);
|
||||
}
|
||||
|
||||
return Convert.ToInt64(sizeElement.Attribute("value").Value);
|
||||
return ParseSize(item.Description());
|
||||
}
|
||||
|
||||
protected override ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult)
|
||||
|
|
|
@ -108,8 +108,6 @@ namespace NzbDrone.Core.Indexers
|
|||
return currentResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string ParseReleaseGroup(string title)
|
||||
{
|
||||
title = title.Trim();
|
||||
|
@ -132,8 +130,6 @@ namespace NzbDrone.Core.Indexers
|
|||
private static readonly Regex ReportSizeRegex = new Regex(@"(?<value>\d+\.\d{1,2}|\d+\,\d+\.\d{1,2}|\d+)\W?(?<unit>GB|MB|GiB|MiB)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
|
||||
|
||||
public static long ParseSize(string sizeString)
|
||||
{
|
||||
var match = ReportSizeRegex.Matches(sizeString);
|
||||
|
|
Loading…
Reference in a new issue