mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-29 23:12:39 +01:00
Fixed: Don't reject revision upgrades if profile doesn't allow upgrades
This commit is contained in:
parent
2f0ca42341
commit
4f0e1c54c1
@ -206,5 +206,19 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new List<CustomFormat>())
|
||||
.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_returntrue_when_quality_is_revision_upgrade_for_same_quality()
|
||||
{
|
||||
_qualityProfile.UpgradeAllowed = false;
|
||||
|
||||
Subject.IsUpgradeAllowed(
|
||||
_qualityProfile,
|
||||
new QualityModel(Quality.DVD, new Revision(1)),
|
||||
new List<CustomFormat> { _customFormatOne },
|
||||
new QualityModel(Quality.DVD, new Revision(2)),
|
||||
new List<CustomFormat> { _customFormatOne })
|
||||
.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,6 +178,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
var isQualityUpgrade = new QualityModelComparer(qualityProfile).Compare(newQuality, currentQuality) > 0;
|
||||
var isCustomFormatUpgrade = qualityProfile.CalculateCustomFormatScore(newCustomFormats) > qualityProfile.CalculateCustomFormatScore(currentCustomFormats);
|
||||
|
||||
if (IsRevisionUpgrade(currentQuality, newQuality))
|
||||
{
|
||||
_logger.Debug("New quality '{0}' is a revision upgrade for '{1}'", newQuality, currentQuality);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((isQualityUpgrade || isCustomFormatUpgrade) && qualityProfile.UpgradeAllowed)
|
||||
{
|
||||
_logger.Debug("Quality profile allows upgrading");
|
||||
|
Loading…
Reference in New Issue
Block a user