mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-20 18:02:44 +01:00
Improve Import Custom Format Compare Logging
This commit is contained in:
parent
996542a4a5
commit
251d2dde97
@ -61,17 +61,27 @@ public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem download
|
||||
}
|
||||
|
||||
movieFile.Movie = localMovie.Movie;
|
||||
var currentFormats = _formatService.ParseCustomFormat(movieFile);
|
||||
var currentScore = qualityProfile.CalculateCustomFormatScore(currentFormats);
|
||||
var currentCustomFormats = _formatService.ParseCustomFormat(movieFile);
|
||||
var currentFormatScore = qualityProfile.CalculateCustomFormatScore(currentCustomFormats);
|
||||
var newCustomFormats = localMovie.CustomFormats;
|
||||
var newFormatScore = localMovie.CustomFormatScore;
|
||||
|
||||
if (qualityCompare == 0 && localMovie.CustomFormatScore < currentScore)
|
||||
if (qualityCompare == 0 && newFormatScore < currentFormatScore)
|
||||
{
|
||||
_logger.Debug("New file's custom formats [{0}] do not improve on [{1}], skipping",
|
||||
localMovie.CustomFormats.ConcatToString(),
|
||||
currentFormats.ConcatToString());
|
||||
_logger.Debug("New item's custom formats [{0}] ({1}) do not improve on [{2}] ({3}), skipping",
|
||||
newCustomFormats != null ? newCustomFormats.ConcatToString() : "",
|
||||
newFormatScore,
|
||||
currentCustomFormats != null ? currentCustomFormats.ConcatToString() : "",
|
||||
currentFormatScore);
|
||||
|
||||
return Decision.Reject("Not a Custom Format upgrade for existing movie file(s)");
|
||||
}
|
||||
|
||||
_logger.Debug("New item's custom formats [{0}] ({1}) do improve on [{2}] ({3}), accepting",
|
||||
newCustomFormats != null ? newCustomFormats.ConcatToString() : "",
|
||||
newFormatScore,
|
||||
currentCustomFormats != null ? currentCustomFormats.ConcatToString() : "",
|
||||
currentFormatScore);
|
||||
}
|
||||
|
||||
return Decision.Accept();
|
||||
|
Loading…
Reference in New Issue
Block a user