feat: refresh a book's metadata from providers on the edit page #89
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!89
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/refresh-metadata"
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 #79
The edit page gets Refresh from providers (disabled, with a tooltip, when the book has no ISBN). It opens
GET /books/:id/refresh, which compares what's saved with what each provider has for the book's ISBN, and lets you pick per field.BookLookup.lookup_all_by_isbn/2asks every configured provider in parallel (Task.async_stream, 15s timeout,on_timeout: :kill_task), normalizes each answer likelookup_by_isbn/1, and skips unconfigured providers. A provider that raises or times out comes back as an error instead of failing the page. Each lookup logs provider, ISBN, outcome and duration.book[...]to the existingPUT /books/:id, so validation is unchanged. Only offered fields are sent.Left out to keep it small: cover refresh, title+author refresh for books without an ISBN, background refresh.
Tests:
book_lookup_all_test.exs(order, unconfigured skipped, raise and timeout isolated),book_refresh_test.exs(edit link and disabled state, only differing fields shown, identifiers never offered, apply updates only picked fields, nothing-differs message) andrefresh_value/1doctests.mix precommitgreen. Browser check at desktop and phone width against live providers: Open Library answered, Google (no-key quota) and LoC reported in the banner; Use all + Apply saved the picked publisher.Note: books added from the ISBN/title lookup tabs only keep title/author/ISBN/language/cover, so this is also the way to fill in their publisher, pages, description, etc.