ADFA-4850: Get More — Books (Project Gutenberg)#259
Merged
Conversation
Extend the durable REST engine so the Books flow is fully REST (the dashboard is becoming the
API). Ports the existing socket.io books handlers:
- GET /api/books/search?q=&filter=&limit= → FTS over the offline catalog.db (query MATCH /
educational / top-by-downloads); returns {gutenberg_id,title,author,language,download_url,
description,cover_url}. cover_url is derived from the Gutenberg id (no image blobs in the DB).
- GET /api/books/library → Calibre-Web metadata.db EPUB books {id,title,author,year}.
- POST /api/books/library/:id/remove → Calibre-Web delete.
Download stays the durable job (POST /api/books/download). Paths don't collide with the generic
/:type/* engine routes. tsc --noEmit clean; dist/ is gitignored (built on rootfs push).
…hub cards Books catalog browse/search with a colored-cover grid and multi-select, feeding BooksDownloadService (foreground, one book at a time — kind to Project Gutenberg — continuing past failures, per-book retry, Finish clears the session). BooksClient talks to the dashboard REST endpoints; reading stays on the home Read a Book card. Get More hub cards are now conditional on the backing module: Books shows only when Calibre-Web answers; Kiwix and Maps always show; Courses stays a TBD placeholder.
Each hub card now shows only when its backing module answers a probe (Wikipedia->kiwix, Books->books/calibre-web, Maps->maps, Courses->kolibri), instead of only Books being conditional. The hub probes all endpoints on open, reveals the ones that respond, and shows a checking / empty-state message otherwise. In a full install nothing changes; on partial installs the hub reflects exactly what is present.
Covers now use a fixed palette (k2go_cover_*) with white text, so contrast holds in dark mode — semantic tokens like k2go_ink flip to near-white and hid the label. Selection/library state moved to a band under the title: green 'In your books', gray 'Selected' (each with a faint stroke so it reads on any cover), instead of a faint whole-card tint. Adds a 'My books' chip that lists the local Calibre-Web library; tapping a book opens its Calibre-Web page (details + Read / Download).
Adds a language selector above the search bar, mirroring the Wikipedia/ZIM flow. The picker only offers languages actually present in the catalog (new /api/books/languages returns distinct languages by stock), so there are no dead options; search takes an optional lang code that narrows every branch. Default is All languages; the pill is hidden under My books (the local library isn't catalog-language filtered).
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.
Native "Get More → Books" (Project Gutenberg), the Books counterpart to the merged Wikipedia/ZIM flow (ADFA-4849), plus the dashboard REST it runs on.
What this adds
Dashboard REST (static/dashboard): /api/books/search (q, filter, lang, limit), /api/books/library, /api/books/library/:id/remove, /api/books/languages.
Verification / coordination