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
parent f8ae95d36f
commit e4f01ae0d4
21 changed files with 524 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
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;
@@ -41,5 +43,16 @@ namespace NzbDrone.Core.Providers.Indexer
{
return new List<string>();
}
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
{
if (currentResult != null)
{
var sizeString = Regex.Match(item.Summary.Text, @"\d+\.\d{1,2} \w{3}", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
}
return currentResult;
}
}
}