Improve Custom Format compare logging
Co-authored-by: Stevie Robinson <stevie.robinson@gmail.com>
This commit is contained in:
parent
f9d9754220
commit
65aeb19486
|
@ -78,7 +78,11 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug("New item has a better custom format score");
|
_logger.Debug("New item's custom formats [{0}] ({1}) improve on [{2}] ({3}), accepting",
|
||||||
|
newCustomFormats.ConcatToString(),
|
||||||
|
newFormatScore,
|
||||||
|
currentCustomFormats.ConcatToString(),
|
||||||
|
currentFormatScore);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,16 +60,26 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentFormats = _formatService.ParseCustomFormat(episodeFile);
|
var currentFormats = _formatService.ParseCustomFormat(episodeFile);
|
||||||
var currentScore = qualityProfile.CalculateCustomFormatScore(currentFormats);
|
var currentFormatScore = qualityProfile.CalculateCustomFormatScore(currentFormats);
|
||||||
|
var newFormats = localEpisode.CustomFormats;
|
||||||
|
var newFormatScore = localEpisode.CustomFormatScore;
|
||||||
|
|
||||||
if (qualityCompare == 0 && localEpisode.CustomFormatScore < currentScore)
|
if (qualityCompare == 0 && newFormatScore < currentFormatScore)
|
||||||
{
|
{
|
||||||
_logger.Debug("New file's custom formats [{0}] do not improve on [{1}], skipping",
|
_logger.Debug("New item's custom formats [{0}] ({1}) do not improve on [{2}] ({3}), skipping",
|
||||||
localEpisode.CustomFormats.ConcatToString(),
|
newFormats != null ? newFormats.ConcatToString() : "",
|
||||||
currentFormats.ConcatToString());
|
newFormatScore,
|
||||||
|
currentFormats != null ? currentFormats.ConcatToString() : "",
|
||||||
|
currentFormatScore);
|
||||||
|
|
||||||
return Decision.Reject("Not a Custom Format upgrade for existing episode file(s)");
|
return Decision.Reject("Not a Custom Format upgrade for existing episode file(s)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.Debug("New item's custom formats [{0}] ({1}) improve on [{2}] ({3}), accepting",
|
||||||
|
newFormats != null ? newFormats.ConcatToString() : "",
|
||||||
|
newFormatScore,
|
||||||
|
currentFormats != null ? currentFormats.ConcatToString() : "",
|
||||||
|
currentFormatScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Decision.Accept();
|
return Decision.Accept();
|
||||||
|
|
Loading…
Reference in New Issue