Age parsing added to the indexers.

This commit is contained in:
Mark McDowall 2012-02-17 16:14:56 -08:00 committed by kay.one
commit 5bf56ffca3
5 changed files with 30 additions and 8 deletions

View file

@ -106,8 +106,13 @@ namespace NzbDrone.Core.Providers.Indexer
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);
var dateString = Regex.Match(item.Summary.Text,
@"(?:\<b\>Added\:\<\/b\>)(?<date>.+?)(?:\<br\s\/\>)",
RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups["date"].Value;
currentResult.Age = DateTime.Today.Subtract(DateTime.Parse(dateString)).Days;
}
return currentResult;
}