New: Added support for limited retention. Reports older than the configured retention are skipped.

pull/19/head
kay.one 13 years ago
parent 0dcbe11a41
commit 9d126e54c9

@ -53,6 +53,7 @@ namespace NzbDrone.Core.Test
parseResults.Should().NotBeEmpty();
parseResults.Should().OnlyContain(s => s.Indexer == mockIndexer.Name);
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
parseResults.Should().OnlyContain(s => s.Age >= 0);
}
private void WithConfiguredIndexers()

@ -218,6 +218,7 @@ namespace NzbDrone.Core.Providers.Indexer
public EpisodeParseResult ParseFeed(SyndicationItem item)
{
var episodeParseResult = Parser.ParseTitle(item.Title.Text);
if (episodeParseResult != null) episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days;
return CustomParser(item, episodeParseResult);
}

@ -112,13 +112,8 @@ namespace NzbDrone.Core.Providers.Indexer
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;
}

@ -81,13 +81,8 @@ namespace NzbDrone.Core.Providers.Indexer
{
var sizeString = Regex.Match(item.Summary.Text, @">\d+\.\d{1,2} \w{2}</a>", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
var dateString = Regex.Match(item.Summary.Text,
@"(?:\<pubDate\>)(?<date>.+?)(?:\<\/pubDate\>)",
RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups["date"].Value;
currentResult.Age = DateTime.Today.Subtract(DateTime.Parse(dateString)).Days;
}
return currentResult;
}

@ -107,13 +107,8 @@ namespace NzbDrone.Core.Providers.Indexer
{
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;
}

@ -104,13 +104,8 @@ namespace NzbDrone.Core.Providers.Indexer
{
var sizeString = Regex.Match(item.Summary.Text, @">\d+\.\d{1,2} \w{2}</a>", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
var dateString = Regex.Match(item.Summary.Text,
@"(?:\<b\>Posted\:\<\/b\>\s)(?<date>.+?)(?:\s[a-zA-Z]+)(?:\<br\s\/\>)",
RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups["date"].Value;
currentResult.Age = DateTime.Today.Subtract(DateTime.Parse(dateString)).Days;
}
return currentResult;
}
}

@ -76,13 +76,8 @@ namespace NzbDrone.Core.Providers.Indexer
{
var sizeString = Regex.Match(item.Summary.Text, @"\d+\.\d{1,2} \w{3}", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
var dateString = Regex.Match(item.Summary.Text,
@"(?:\<pubDate\>)(?<date>.+?)(?:\<\/pubDate\>)",
RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups["date"].Value;
currentResult.Age = DateTime.Today.Subtract(DateTime.Parse(dateString)).Days;
}
return currentResult;
}
}

Loading…
Cancel
Save