Repository navigation
Conversation
The thumbnail address was rewritten to a larger zoom. When Google has no larger scan it answers with a blank "image not available" picture, and that picture was what got saved. The search list also often leaves the description out, and the book page trusted that empty answer. Keep the thumbnail Google sent, ask for the volume when the blurb is missing, and change the cover address when the saved file changes so a browser does not keep the blank picture. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
What does this change?
Follow-up to #174. Two cases where Google Books has a cover and a description, and the book page showed neither.
zoom=1tozoom=3. When Google has no larger scan,zoom=3is a blank picture that says "image not available", and that picture was saved and shown. The real thumbnail, even when it is small, is kept.?v=from the time of the saved file. Browsers keep/api/book-covers/gb-<id>.jpgfor a month and will not ask again, so a cover that was replaced stayed blank on screen. The new address makes the browser fetch the picture that is actually saved.Why?
Seen with L'elmo di Scipio (Angelo Soro, 2025). Google Books has the yellow cover and the full Italian description. Mediarium showed the blank "image not available" picture and, until the volume was asked for, no description. The book is on neither Open Library nor Hardcover, so this page is entirely what Google Books returned. The description came back once the volume was requested. The cover on disk was already the real thumbnail, but the browser kept serving the blank picture it had stored for that same address.
How did you test it?
gofmt -won the touched files, thengofmtleft them unchanged.go test ./internal/books/ ./internal/api/ -count=1 -run 'TestGoogle|TestMergeGoogle'passes. New cases: azoom=1thumbnail stayszoom=1and losesedge=curl; a volume with no description uses the search extract; a book page whose list hit has no description asks for that volume and shows it; a saved Google cover address may carry?v=.?v=address is what shows that thumbnail instead of the cached blank picture.docs/books.mdalready says Google Books fills a missing cover or description, so that page was left as it is.CHANGELOG.mdhas the fix under Unreleased.Checklist
go test ./...passes andgofmt -l .prints nothingnpm run lint,npm testandnpm run buildpass inweb/docs/updated, and a line added toCHANGELOG.mdunder "Unreleased"go run ./tools/docgenand committed the resultMade with Cursor