Size is now parsed for each item in the feed.

QualityType added to database to allow saving of size limits.
Fluent now uses longs for multiplication, to ensure it doesn't overflow.
This commit is contained in:
Mark McDowall 2011-09-13 19:25:33 -07:00
commit e4f01ae0d4
21 changed files with 524 additions and 6 deletions

View file

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.ServiceModel.Syndication;
using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Search;
using NzbDrone.Core.Providers.Core;
@ -67,5 +69,15 @@ namespace NzbDrone.Core.Providers.Indexer
return searchUrls;
}
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
{
if (currentResult != null)
{
var sizeString = Regex.Match(item.Summary.Text, @"<b>Size:</b> \d+\.\d{1,2} \w{2}<br />", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
}
return currentResult;
}
}
}