# Develop Changelog ## 2026-04-03 (3) - DB chapter editor: Monaco-based editor now supports DB-stored books - `GET /library/editor/{filename}` handles `db/…` filenames; `is_db` flag passed to template - `GET /api/edit/chapter/{index}/{filename}` and `POST …`: DB branches query/update `book_chapters` directly; save calls `upsert_chapter` (updates `content_tsv` too) - `POST /api/edit/chapter/add/{filename}` and `DELETE …`: DB branches insert/delete with `chapter_index` shift via `UPDATE … SET chapter_index = chapter_index ± 1` - Title editing: header chapter-name replaced with a text input for DB books; `pendingTitles` map preserves unsaved titles across chapter switches (parallel to `pendingContent`); title-only dirty chapters correctly saved in Save All - `insertBreak`: scene-break image path is `/static/break.png` for DB books (vs `../Images/break.png` for EPUB) - Fix: `editor.focus()` called after content load so Monaco receives keyboard focus immediately - Fix: `header-chapter` "Loading…" text suppressed for DB books where that element is hidden - `book.html`: "Edit chapters" button shown for `storage_type = 'db'` books - Search: chapter titles now included in FTS - `upsert_chapter` prepends title to the plain-text input for `to_tsvector`: `title + " " + stripped_html` - `GET /api/search`: added `OR LOWER(bc.title) LIKE LOWER('%…%')` fallback for chapters whose title matches but content doesn't - Startup migration `migrate_rebuild_chapter_tsv_with_title()` rebuilds existing `content_tsv` values to include titles - Grabber: added DB/EPUB storage toggle on the Convert page - UI toggle above Convert button ("Save as: DB | EPUB file"); `storageMode` JS variable sent in POST body - `POST /convert`: reads `storage_mode` from body; stored in job as `'db'` or `'epub'` - `_run_scrape`: EPUB path builds chapters via `make_chapter_xhtml`, calls `make_epub`, writes file, calls `upsert_book(storage_type='file')`; DB path unchanged - `done` SSE event includes `storage_type`; `conversion.js` updates the download button label/action accordingly - EPUB → DB conversion: fixed double chapter title - `_epub_body_inner` strips the first `

`/`

`/`

` heading from each chapter body before storing; the editor prepends its own heading, so storing the EPUB heading too caused it to appear twice - Fix for `NavigableString` crash: `getattr(child, "name", None) is None` used instead of `hasattr(child, "name")` — `NavigableString` has `name = None` but no `decompose()` method - Sidebar: Search link styling fixed - Stray `
  • Search
  • ` moved inside the Library `