mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Prevent regrab for all grabs
Fixed: Prevent incorrectly grabbing a similar or identical release for 12 hours
This commit is contained in:
parent
6f7fea3591
commit
c00c207517
@ -103,12 +103,12 @@ public void should_return_true_if_latest_history_item_is_not_grabbed()
|
|||||||
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
// [Test]
|
||||||
public void should_return_true_if_latest_history_has_a_download_id_and_cdh_is_enabled()
|
// public void should_return_true_if_latest_history_has_a_download_id_and_cdh_is_enabled()
|
||||||
{
|
// {
|
||||||
GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
|
// GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
|
||||||
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
// _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
||||||
}
|
// }
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_return_true_if_latest_history_item_is_older_than_twelve_hours()
|
public void should_return_true_if_latest_history_item_is_older_than_twelve_hours()
|
||||||
|
@ -46,18 +46,18 @@ public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase
|
|||||||
|
|
||||||
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
|
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
|
||||||
{
|
{
|
||||||
var recentBlackhole = mostRecent.DownloadId.IsNullOrWhiteSpace() && mostRecent.Date.After(DateTime.UtcNow.AddHours(-12));
|
var recent = mostRecent.Date.After(DateTime.UtcNow.AddHours(-12));
|
||||||
var cutoffUnmet = _qualityUpgradableSpecification.CutoffNotMet(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality);
|
var cutoffUnmet = _qualityUpgradableSpecification.CutoffNotMet(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality);
|
||||||
var upgradeable = _qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality);
|
var upgradeable = _qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, mostRecent.Quality, subject.ParsedEpisodeInfo.Quality);
|
||||||
|
|
||||||
if (!recentBlackhole && cdhEnabled)
|
if (!recent && cdhEnabled)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cutoffUnmet)
|
if (!cutoffUnmet)
|
||||||
{
|
{
|
||||||
if (recentBlackhole)
|
if (recent)
|
||||||
{
|
{
|
||||||
return Decision.Reject("Recent grab event in history already meets cutoff: {0}", mostRecent.Quality);
|
return Decision.Reject("Recent grab event in history already meets cutoff: {0}", mostRecent.Quality);
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase
|
|||||||
|
|
||||||
if (!upgradeable)
|
if (!upgradeable)
|
||||||
{
|
{
|
||||||
if (recentBlackhole)
|
if (recent)
|
||||||
{
|
{
|
||||||
return Decision.Reject("Recent 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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user