mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user