M8c: Item editing (metadata, covers, matching, chapters, quick match) #24

Merged
mett merged 2 commits from feat/m8c-item-editing into main 2026-10-29 14:42:54 +01:00
Owner

Last of the three M8 parts: editing items. With #22 and #23 this finishes the milestone.

Closes #8

What's in it

  • Edit page (/edit/:id), opened from an "Edit" button on book and podcast pages. Shown to users with the server's update permission (admins always), as decided.
    • Details: every book field (title, subtitle, authors, narrators, series with numbers, genres, tags, year, publisher, description, ISBN, ASIN, language, explicit, abridged). Podcasts get title, author, feed URL, genres, language, description, explicit. Blank text clears a field.
    • Cover: upload a JPEG/PNG/WebP from this computer (multipart, 20 MB max), let the server fetch a URL, search a provider and pick from a grid, or remove the cover.
    • Match (books): search a provider, pick a result, then tick fields in an old/new table. Fields that the result has and that differ are preselected; the cover is applied through the server's URL fetch.
    • Chapters (books): edit starts (h:mm:ss, milliseconds kept) and titles, add and remove, listen from a start. Audnexus lookup by ASIN and region with a preview, a warning when its length differs from the book, a time shift or "titles only"; nothing is saved until "Save chapters". Rust saves chapters sorted and closed (each ends where the next starts, the last at the book's end).
  • Quick match on the Admin page for audiobook libraries, with "replace existing details" and "replace existing covers" (both off by default), using the library's provider. It goes through /api/items/batch/quickmatch; the result (batch_quickmatch_complete) shows on the page, and the sidebar dot pulses meanwhile.

Tests

  • pnpm check 0 errors; Prettier clean on tracked and new files; cargo fmt --check and cargo clippy --all-targets -D warnings clean.
  • cargo test against the test server (ABS 2.37.2 via Podman): all pass. New live_edit.rs edits a copy of a test book in a library of its own under metadata/ (no other library watches it), so the shared test books stay untouched:
    • metadata round trip, clearing a field, chapters out of order, removing and uploading a cover, a non-image rejected;
    • with internet on the server: Audible search, cover search, cover from URL, Audnexus lookup (and an invalid ASIN), quick match filling empty fields without touching the title. These parts skip themselves when the provider finds nothing.
    • It also edits the test podcast and restores it.
  • Unit tests for chapter normalizing, the update body, provider results (comma lists, numeric years and sequences), and Audnexus errors.
  • By hand in tauri dev on a sandbox copy. The mouse couldn't be driven (Wayland focus), so I clicked through via WebKit's remote inspector: details save, Audible match with a field left out, Audnexus "titles only" + save, cover from search and remove, the book page with the Edit button, quick match on the Admin page, and the podcast edit page (viewed only).
  • Not tested by hand: the file dialog for uploading (the upload itself is in the live test), and the Edit button staying hidden for a user without update permission. Windows build not tested.

🤖 Generated with Claude Code

Last of the three M8 parts: editing items. With #22 and #23 this finishes the milestone. Closes #8 ## What's in it - **Edit page** (`/edit/:id`), opened from an "Edit" button on book and podcast pages. Shown to users with the server's update permission (admins always), as decided. - **Details:** every book field (title, subtitle, authors, narrators, series with numbers, genres, tags, year, publisher, description, ISBN, ASIN, language, explicit, abridged). Podcasts get title, author, feed URL, genres, language, description, explicit. Blank text clears a field. - **Cover:** upload a JPEG/PNG/WebP from this computer (multipart, 20 MB max), let the server fetch a URL, search a provider and pick from a grid, or remove the cover. - **Match** (books): search a provider, pick a result, then tick fields in an old/new table. Fields that the result has and that differ are preselected; the cover is applied through the server's URL fetch. - **Chapters** (books): edit starts (h:mm:ss, milliseconds kept) and titles, add and remove, listen from a start. Audnexus lookup by ASIN and region with a preview, a warning when its length differs from the book, a time shift or "titles only"; nothing is saved until "Save chapters". Rust saves chapters sorted and closed (each ends where the next starts, the last at the book's end). - **Quick match** on the Admin page for audiobook libraries, with "replace existing details" and "replace existing covers" (both off by default), using the library's provider. It goes through `/api/items/batch/quickmatch`; the result (`batch_quickmatch_complete`) shows on the page, and the sidebar dot pulses meanwhile. ## Tests - `pnpm check` 0 errors; Prettier clean on tracked and new files; `cargo fmt --check` and `cargo clippy --all-targets -D warnings` clean. - `cargo test` against the test server (ABS 2.37.2 via Podman): all pass. New `live_edit.rs` edits a **copy** of a test book in a library of its own under `metadata/` (no other library watches it), so the shared test books stay untouched: - metadata round trip, clearing a field, chapters out of order, removing and uploading a cover, a non-image rejected; - with internet on the server: Audible search, cover search, cover from URL, Audnexus lookup (and an invalid ASIN), quick match filling empty fields without touching the title. These parts skip themselves when the provider finds nothing. - It also edits the test podcast and restores it. - Unit tests for chapter normalizing, the update body, provider results (comma lists, numeric years and sequences), and Audnexus errors. - **By hand** in `tauri dev` on a sandbox copy. The mouse couldn't be driven (Wayland focus), so I clicked through via WebKit's remote inspector: details save, Audible match with a field left out, Audnexus "titles only" + save, cover from search and remove, the book page with the Edit button, quick match on the Admin page, and the podcast edit page (viewed only). - Not tested by hand: the file dialog for uploading (the upload itself is in the live test), and the Edit button staying hidden for a user without update permission. Windows build not tested. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- api/edit.rs: load a book or podcast for editing and save its metadata
  (books: title, subtitle, authors, narrators, series, genres, tags, year,
  publisher, description, ISBN, ASIN, language, explicit, abridged;
  podcasts: title, author, description, genres, language, feed URL,
  explicit). Blank text clears a field.
- Covers: upload a JPEG/PNG/WebP from this computer (multipart, 20 MB
  at most), let the server fetch one from a URL, search a provider's
  covers, remove the cover.
- Matching: provider search results in the shape of the editable fields;
  the UI picks fields. Audnexus chapters by ASIN and region.
- Chapters are saved sorted, numbered and closed (each ends where the next
  starts, the last at the book's end).
- Quick match of a whole library with "override details" and "override
  cover"; the end arrives over the socket as admin://quick-match.
- live_edit.rs: edits a copy of a test book in a library of its own under
  metadata/ (no other library watches it), including provider search,
  covers, Audnexus and quick match when the server reaches the internet;
  edits the test podcast and puts it back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M8 UI: edit page (details, cover, match, chapters), quick match
Some checks failed
CI / linux (pull_request) Has been cancelled
CI / fedora (pull_request) Has been cancelled
CI / windows (pull_request) Has been cancelled
13758cd93b
- "Edit" on book and podcast pages for users with the server's update
  permission (session.canEdit), opening /edit/:id with tabs.
- Details: every book field (lists as comma text, series rows with
  numbers) or the podcast fields; blank text clears.
- Cover: upload a file (file dialog), use a URL, search a provider and
  pick from a grid, or remove.
- Match (books): search a provider, pick a result, then tick the fields
  to take over in an old/new table; changed fields are preselected.
- Chapters (books): edit starts (h:mm:ss, milliseconds kept) and titles,
  add/remove, listen from a start; Audnexus lookup by ASIN and region
  with a preview, a warning when the length differs, a time shift or
  "titles only", applied to the editor before saving.
- Admin page: Quick match per audiobook library with "replace existing
  details" and "replace existing covers"; the result shows when the server
  reports it, and the sidebar dot pulses meanwhile.
- PLAN.md/README: M8 done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mett merged commit eac843fc9b into main 2026-10-29 14:42:54 +01:00
Sign in to join this conversation.
No description provided.