diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs index ce2484151..66b8df8aa 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs @@ -101,5 +101,23 @@ namespace NzbDrone.Core.Test.DecisionEngineTests new QualityModel(Quality.FLAC, new Revision(version: 2)), 10).Should().BeTrue(); } + + + [Test] + public void should_return_true_if_cutoffs_are_met_but_is_a_revision_upgrade() + { + QualityProfile _profile = new QualityProfile + { + Cutoff = Quality.MP3_320.Id, + Items = Qualities.QualityFixture.GetDefaultQualities(), + }; + + Subject.CutoffNotMet( + _profile, + new List { new QualityModel(Quality.FLAC, new Revision(version: 1)) }, + NoPreferredWordScore, + new QualityModel(Quality.FLAC, new Revision(version: 2)), + NoPreferredWordScore).Should().BeTrue(); + } } } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs index 3b01f5e3e..0057b3f67 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs @@ -94,14 +94,14 @@ namespace NzbDrone.Core.DecisionEngine.Specifications public bool QualityCutoffNotMet(QualityProfile profile, QualityModel currentQuality, QualityModel newQuality = null) { - var qualityCompare = new QualityModelComparer(profile).Compare(currentQuality.Quality.Id, profile.Cutoff); + var cutoffCompare = new QualityModelComparer(profile).Compare(currentQuality.Quality.Id, profile.Cutoff); - if (qualityCompare < 0) + if (cutoffCompare < 0) { return true; } - if (qualityCompare == 0 && newQuality != null && IsRevisionUpgrade(currentQuality, newQuality)) + if (newQuality != null && IsRevisionUpgrade(currentQuality, newQuality)) { return true; }