|
|
|
@ -64,16 +64,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
|
|
|
|
{
|
|
|
|
|
var bookFiles = _mediaFileService.GetFilesByBook(book.Id);
|
|
|
|
|
|
|
|
|
|
if (bookFiles.Any())
|
|
|
|
|
foreach (var file in bookFiles)
|
|
|
|
|
{
|
|
|
|
|
var currentQualities = bookFiles.Select(c => c.Quality).Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
var upgradable = _upgradableSpecification.IsUpgradable(qualityProfile,
|
|
|
|
|
currentQualities,
|
|
|
|
|
_preferredWordServiceCalculator.Calculate(subject.Author, bookFiles[0].GetSceneOrFileName()),
|
|
|
|
|
subject.ParsedBookInfo.Quality,
|
|
|
|
|
subject.PreferredWordScore);
|
|
|
|
|
if (upgradable)
|
|
|
|
|
var currentQuality = file.Quality;
|
|
|
|
|
var newQuality = subject.ParsedBookInfo.Quality;
|
|
|
|
|
var qualityCompare = qualityComparer.Compare(newQuality?.Quality, currentQuality.Quality);
|
|
|
|
|
|
|
|
|
|
if (qualityCompare == 0 && newQuality?.Revision.CompareTo(currentQuality.Revision) > 0)
|
|
|
|
|
{
|
|
|
|
|
_logger.Debug("New quality is a better revision for existing quality, skipping delay");
|
|
|
|
|
return Decision.Accept();
|
|
|
|
|