Skip to content

Book details helper and finding free books online - #6

Merged
Mischou01 merged 2 commits into
mainfrom
book-details
Oct 25, 2026
Merged

Mischou01 merged 2 commits into
mainfrom
book-details

Conversation

@Mischou01

Copy link
Copy Markdown
Owner

The two online features planned in docs/ONLINE.md, plus editing details by hand.

Book details (About this book → pencil)

  • Edit details: title, authors (one per line), series and number, description, publisher, date, ISBN, language. Only changed fields are saved.
  • Storage: per-field edits with their own timestamps in the book's record in .readlet/ (details, detailsResetAt), merged field by field across devices; the book file is never touched. Applied in Rust (BookEntry::with_edits), so the reader title, read-aloud language, series grouping and export all see them. Synced edits refresh via a new get_books.
  • Cover: choose an image or "No cover". The thumbnail is stored in .readlet/devices/<id>/covers/<fp>-<t>.jpg; the record points at it with its palette; cover:// serves it. Paths from records are validated, since they sync from other devices.
  • Find details online: Open Library search (by ISBN when the book has one), pick an edition, tick fields to use. Only blank fields (and a missing cover) start ticked; values fill the form and nothing is saved until Save.
  • Reset: "Use the book's own details", on every device, with Undo (text fields; a reset cover isn't restored by Undo).

Find books online (library search → "Search online for …")

  • Project Gutenberg's OPDS search; downloads /ebooks/<id>.epub3.images, checks it's an EPUB, and adds it via Library::add_books (no overwrites, duplicates skipped). Books already in the library are marked.
  • When there's no free edition: plain links to Kobo, Baen, Weightless Books, Smashwords and Libreture's directory.

Network

  • src-tauri/src/net.rs (ureq + rustls, no OpenSSL): redirects followed by hand, allowlist of openlibrary.org, covers.openlibrary.org, archive.org, *.us.archive.org, www.gutenberg.org; size caps; downloads streamed to disk. Requests happen only on an explicit action.
  • img-src allows the same hosts for result thumbnails. README and the Settings hint now say what goes online.

Test plan

  • bun run check: typecheck, lint, format, 102 tests
  • Rust store, index, merge, net, lookup and catalog modules built and tested in an isolated crate (54 tests, clippy clean), plus live runs against Open Library and Gutenberg (search, details, cover through two redirects, a 1 MB EPUB download)
  • UI clicked through in headless Chromium at desktop and phone sizes with a mocked core
  • Full crate compile, clippy and APK (CI; commands.rs, protocol.rs and wiring couldn't be compiled locally)
  • On a device: choose a cover from a file (Android's file chooser for <input type=file>), find details online, download a Gutenberg book

🤖 Generated with Claude Code

Mischou01 and others added 2 commits October 25, 2026 16:08
Book details (About this book → pencil):
- Edit title, authors, series, description, publisher, date, ISBN and
  language. Edits are stored per field with their own timestamps in the
  book's record in .readlet/, so they sync and merge field by field; the
  book file is never touched. They're applied in Rust, so every screen
  sees them. A reset drops all edits on every device.
- Choose a cover from a file, or none. The thumbnail goes in this
  device's .readlet/devices/<id>/covers/ and the cover:// scheme serves
  it; its palette is kept in the record.
- Find details online: searches Open Library (by ISBN when the book has
  one), lets the reader pick an edition and tick which fields (and the
  cover) to use. Only blanks start ticked; nothing is saved until Save.

Find books online (library search → "Search online for …"):
- Searches Project Gutenberg's OPDS catalogue and downloads EPUBs into
  the books folder through Library::add_books. Books already in the
  library are marked. Links to DRM-free stores when there's no free
  edition.

All requests go through src-tauri/src/net.rs (ureq with rustls), which
follows redirects by hand and only to Open Library, the Internet
Archive's cover servers and www.gutenberg.org, and only on an explicit
action. img-src allows the same hosts for result thumbnails. README and
the Settings hint say what goes online; docs/ONLINE.md records what was
built and decided.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mischou01
Mischou01 merged commit 745343b into main Oct 25, 2026
6 checks passed
@Mischou01
Mischou01 deleted the book-details branch October 25, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant