feat: pick another batch-scan result (Closes #99) #101
No reviewers
Labels
No labels
bug
critical
ebook-branch
high
low
main
medium
release-blocker
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/fuzzy_catalog!101
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/batch-pick-result"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #99
Stacked on #98 (batch scanner Add Book tab); retarget to main after #98 merges.
Default pick (F6): an ISBN lookup now asks every provider and picks the best answer by a quality score (title, authors, pages, cover, description, ISBN match; placeholder/"Untitled" records score low), so an Open Library stub no longer beats a full Google record.
Pick another result: batch add returns the other providers' answers. Each added row in the scanner has an "Other results" list with a "Use this" button; a weak default gets a "Check match" badge, opens the list, and is flagged for metadata review.
POST /books/:id/batch-pickre-fetches the chosen provider's record server-side (client data is never trusted) and applies it: 409 if it would duplicate another book, 422 for an unknown provider or failed lookup. Provider text is rendered with textContent only.Logging: batch pick logs book id, provider, status and duration.
Tests: book_batch_pick_test.exs (swap, 409, 422, 404), quality score tests incl. Nye's F6 test; jsdom UI check (list, badge, pick POST, row update, no HTML injection).
mix precommit: 720 passed.lookup_by_isbn took the first provider that answered, so Open Library's pre-order placeholder ("Untitled 4212B" by "Ballantine") beat Google's complete record for 9780399594212. Every provider is now asked at once and the answers ranked by quality_score/2; lookup_best_by_isbn/2 also returns the other answers for picking another one.