mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Age parsing added to the indexers.
This commit is contained in:
parent
64ca52667b
commit
5bf56ffca3
5 changed files with 30 additions and 8 deletions
|
@ -105,16 +105,19 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
if (currentResult != null)
|
||||
{
|
||||
var quality = Parser.ParseQuality(item.Summary.Text);
|
||||
|
||||
currentResult.Quality = quality;
|
||||
|
||||
var languageString = Regex.Match(item.Summary.Text, @"Language - \w*", RegexOptions.IgnoreCase).Value;
|
||||
|
||||
currentResult.Language = Parser.ParseLanguage(languageString);
|
||||
|
||||
var sizeString = Regex.Match(item.Summary.Text, @"\(Size: \d*\,?\d+\.\d{1,2}\w{2}\)", RegexOptions.IgnoreCase).Value;
|
||||
|
||||
currentResult.Size = Parser.GetReportSize(sizeString);
|
||||
|
||||
var dateString = Regex.Match(item.Summary.Text,
|
||||
@"(?:\<li\>PostDate\:\s)(?<date>.+?(AM|PM))(?:\s[a-zA-Z]+)(?:\<\/li\>)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups["date"].Value;
|
||||
|
||||
currentResult.Age = DateTime.Today.Subtract(DateTime.Parse(dateString)).Days;
|
||||
}
|
||||
return currentResult;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue