1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

HistorySpecification checks cutoff as well

This commit is contained in:
Mark McDowall
2015-10-15 00:23:14 -07:00
parent f7859c8eb5
commit 20df619ddd
2 changed files with 19 additions and 3 deletions
@@ -40,9 +40,14 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed && mostRecent.DownloadId.IsNullOrWhiteSpace() && mostRecent.Date.After(DateTime.UtcNow.AddHours(-1)))
{
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality))
{
return Decision.Reject("Recent grab event in history already meets cutoff: {0}", mostRecent.Quality);
}
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality))
{
return Decision.Reject("Existing grab event in history is of equal or higher quality: {0}", mostRecent.Quality);
return Decision.Reject("Recent grab event in history is of equal or higher quality: {0}", mostRecent.Quality);
}
}
}