Fixed: Avoid upgrades for custom formats cut-off already met

pull/6523/head
Bogdan 4 months ago committed by Mark McDowall
parent 6f6036a199
commit 8dd8c95f36

@ -46,28 +46,37 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
return false;
}
var qualityRevisionComapre = newQuality?.Revision.CompareTo(currentQuality.Revision);
var qualityRevisionCompare = newQuality?.Revision.CompareTo(currentQuality.Revision);
// Accept unless the user doesn't want to prefer propers, optionally they can
// use preferred words to prefer propers/repacks over non-propers/repacks.
if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
qualityRevisionComapre > 0)
qualityRevisionCompare > 0)
{
_logger.Debug("New item has a better quality revision, skipping. Existing: {0}. New: {1}", currentQuality, newQuality);
return true;
}
var currentFormatScore = qualityProfile.CalculateCustomFormatScore(currentCustomFormats);
var newFormatScore = qualityProfile.CalculateCustomFormatScore(newCustomFormats);
// Reject unless the user does not prefer propers/repacks and it's a revision downgrade.
if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
qualityRevisionComapre < 0)
qualityRevisionCompare < 0)
{
_logger.Debug("Existing item has a better quality revision, skipping. Existing: {0}. New: {1}", currentQuality, newQuality);
return false;
}
var currentFormatScore = qualityProfile.CalculateCustomFormatScore(currentCustomFormats);
var newFormatScore = qualityProfile.CalculateCustomFormatScore(newCustomFormats);
if (qualityProfile.UpgradeAllowed && currentFormatScore >= qualityProfile.CutoffFormatScore)
{
_logger.Debug("Existing item meets cut-off for custom formats, skipping. Existing: [{0}] ({1}). Cutoff score: {2}",
currentCustomFormats.ConcatToString(),
currentFormatScore,
qualityProfile.CutoffFormatScore);
return false;
}
if (newFormatScore <= currentFormatScore)
{
_logger.Debug("New item's custom formats [{0}] ({1}) do not improve on [{2}] ({3}), skipping",
@ -123,7 +132,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
return true;
}
_logger.Debug("Existing item meets cut-off. skipping. Existing: {0}", currentQuality);
_logger.Debug("Existing item meets cut-off, skipping. Existing: {0}", currentQuality);
return false;
}

Loading…
Cancel
Save