fix(metadata-match): include cover image in match score calculation and correct weight aggregation (#2513)

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
Balázs Szücs
2026-01-28 00:29:29 +01:00
committed by GitHub
parent 54eb3e0ee0
commit 6c4934b8ba
2 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,6 @@ public class MetadataMatchWeights {
seriesName + seriesNumber + seriesTotal + isbn13 + isbn10 + language +
pageCount + categories + amazonRating + amazonReviewCount +
goodreadsRating + goodreadsReviewCount + hardcoverRating +
hardcoverReviewCount + doubanRating + doubanReviewCount +
ranobedbRating + coverImage;
hardcoverReviewCount + ranobedbRating + coverImage;
}
}

View File

@@ -4,8 +4,8 @@ import com.adityachandel.booklore.model.dto.settings.AppSettings;
import com.adityachandel.booklore.model.dto.settings.MetadataMatchWeights;
import com.adityachandel.booklore.model.entity.BookEntity;
import com.adityachandel.booklore.model.entity.BookMetadataEntity;
import com.adityachandel.booklore.service.book.BookQueryService;
import com.adityachandel.booklore.service.appsettings.AppSettingService;
import com.adityachandel.booklore.service.book.BookQueryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -64,6 +64,7 @@ public class MetadataMatchService {
if (isPositive(metadata.getHardcoverRating(), metadata.getHardcoverRatingLocked())) score += weights.getHardcoverRating();
if (isPositive(metadata.getHardcoverReviewCount(), metadata.getHardcoverReviewCountLocked())) score += weights.getHardcoverReviewCount();
if (isPositive(metadata.getRanobedbRating(), metadata.getRanobedbRatingLocked())) score += weights.getRanobedbRating();
if (metadata.getCoverUpdatedOn() != null || Boolean.TRUE.equals(metadata.getCoverLocked())) score += weights.getCoverImage();
return (score / totalWeight) * 100f;
}