mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-20 21:55:03 -04:00
Fixed: Incorrectly grabbing revision downgrades (#6194)
This commit is contained in:
@@ -32,6 +32,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
{
|
||||
var qualityComparer = new QualityModelComparer(profile);
|
||||
var qualityCompare = qualityComparer.Compare(newQuality?.Quality, currentQuality.Quality);
|
||||
var downloadPropersAndRepacks = _configService.DownloadPropersAndRepacks;
|
||||
|
||||
if (qualityCompare > 0)
|
||||
{
|
||||
@@ -45,10 +46,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
return false;
|
||||
}
|
||||
|
||||
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 (_configService.DownloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
|
||||
newQuality?.Revision.CompareTo(currentQuality.Revision) > 0)
|
||||
if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
|
||||
qualityRevisionCompare > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -56,6 +59,14 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
var currentFormatScore = profile.CalculateCustomFormatScore(currentCustomFormats);
|
||||
var newFormatScore = profile.CalculateCustomFormatScore(newCustomFormats);
|
||||
|
||||
// Reject unless the user does not prefer propers/repacks and it's a revision downgrade.
|
||||
if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
|
||||
qualityRevisionCompare < 0)
|
||||
{
|
||||
_logger.Debug("Existing item has a better quality revision, skipping");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newFormatScore <= currentFormatScore)
|
||||
{
|
||||
_logger.Debug("New item's custom formats [{0}] do not improve on [{1}], skipping",
|
||||
|
||||
Reference in New Issue
Block a user