github new-usemame/Calibre-Web-NextGen v4.0.20
v4.0.20 — fix cover-picker dark theme + unblock external covers

latest releases: v4.0.135, v4.0.134, v4.0.133...
18 days ago

v4.0.20 — cover-picker visibility + image-fetch fix

Suggested release title:

v4.0.20 — fix cover-picker dark theme + unblock external covers

Release body

A focused patch on top of v4.0.19's cover-picker. Three issues that only surfaced after end-to-end browser-driving the deployed instance under the caliBlur dark theme — none of them showed up in unit tests because they're rendering-environment-specific. If you tried v4.0.19 and the cover-picker page looked broken or empty, this fixes it.

Get it

docker pull ghcr.io/new-usemame/calibre-web-nextgen:v4.0.20

Same volume layout as v4.0.19; no migration.

Fixes

  • CSP was blocking every external cover URL on the new picker page. The img-src * exception in cps/web.py was scoped only to the existing edit-metadata modal endpoint. The new /book/<id>/cover page wasn't on the list, so all 14 providers' covers (Apple Books, Hardcover, Amazon image CDN, OpenLibrary, Kobo, Douban, etc.) were CSP-blocked at browser load time. Only the embedded-cover candidate (a data: URL) rendered. Picker grid now fully populates.

  • Picker CSS was light-theme-only — invisible on caliBlur. The fork's caliBlur theme adds class="blur" to <body> and uses a dark background with near-white body text. The picker styled cards / panels with hardcoded light colors, and text inside those cards inherited body's near-white color → titles, panel summaries, "Lock cover" label, help text, candidate metadata all rendered as white-on-white. Rewrote cover_picker.css to flow every color through CSS custom properties scoped to .cwa-cover-picker, with body.blur overriding to a dark variant. Same approach applied to the inline cover-URL preview block on the edit-metadata page.

  • URL preview always returned "Could not reach that URL". cover_url_validator.validate_cover_url was calling cw_advocate.head(...), but that vendored library only exports request, get, post, etc. — there is no top-level head. The AttributeError got caught by a generic except and surfaced as unreachable, so even known-good URLs failed validation. Switched to cw_advocate.request("HEAD", ...). Live: pasting https://m.media-amazon.com/images/P/1853260010.01._SCRM_SL2000_.jpg now returns 1300×2000 · 359 KB · image/jpeg with the preview thumbnail shown inline.

Also

  • Candidate cards whose images fail to load (network 4xx, anti-scraping HTTP 418 from Douban, etc.) now show a labeled "Cover not reachable" placeholder instead of leaving an empty white box. Failed candidates remain pickable.
  • A previous successful URL-preview's "Use this cover" action no longer lingers when the user types a worse URL afterwards.

Validation

End-to-end driven through a real browser against the deployed instance under the caliBlur theme: 67 candidate covers render, panel summaries readable, lock toggle visible, API-keys panel readable with "Configured"/"Not configured" labels and Save buttons. 14 unit tests for the URL validator still pass.

Don't miss a new Calibre-Web-NextGen release

NewReleases is sending notifications on new releases.