feat(metadata): prefer Kindle for Amazon metadata#2471
Closed
lyallcooper wants to merge 1 commit intobooklore-app:developfrom
Closed
feat(metadata): prefer Kindle for Amazon metadata#2471lyallcooper wants to merge 1 commit intobooklore-app:developfrom
lyallcooper wants to merge 1 commit intobooklore-app:developfrom
Conversation
…r Amazon Prioritize Kindle editions when fetching Amazon metadata: - Search for Kindle format first, falling back to Paperback then Hardcover - Kindle ASINs typically provide better ebook-specific metadata Fix review rating and count extraction for all page formats: - Use direct selectors (#acrPopover, #acrCustomerReviewText) instead of parent containers which differ between Kindle and physical book pages - Extract rating from title attribute using regex that works across all locales (US: "4.6 out of 5", DE: "4,6 von 5", JP: "5つ星のうち4.2") - Handles both decimal separators (. vs ,) and thousand separators Add unit tests for rating/count extraction and format prioritization.
6e76a93 to
2009b87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This change prioritizes the kindle version of a given book when fetching metadata from Amazon over the current paperback/hardback prioritization. Kindle versions, being the only e-book versions on Amazon, usually have more applicable metadata for a given e-book.
Linked Issue: Fixes #1284
🏷️ Type of Change
🔧 Changes
🧪 Testing (MANDATORY)
Manual testing steps you performed:
ghcr.io/lyallcooper/booklore:develop-bff7319fon my forkRegression testing:
Edge cases covered:
Test output:
Backend test output (
./gradlew test)Frontend test output (
ng test)📸 Screen Recording / Screenshots (MANDATORY)
booklore-before.mp4
booklore-after.mp4
✅ Pre-Submission Checklist
develop(merge conflicts resolved)🤖 AI-Assisted Contributions
TODOs, or unused scaffolding left behind by AI