Highlights
Fixes the "Generate Kobo Auth Token Fails — blank page" bug. Tracks upstream issue crocodilestick/Calibre-Web-Automated#1328 (reporter @blahblah57).
Plain-English
If clicking Profile → Create/View Kobo Auth Token gave you a blank page (with a sqlite "bad parameter" error in the server log), this release fixes it.
docker pull ghcr.io/new-usemame/calibre-web-nextgen:latest
What was wrong
The token-generation route ran query(Books).join(Data).all() (which duplicates books with multiple formats) and then accessed book.data per row, which lazy-loaded each book's formats again — N+1 queries on the request-scoped session. When a worker thread crashed mid-request, a sibling connection from the shared pool could end up in a poisoned state, and the next lazy-load failed with sqlite3.InterfaceError: bad parameter or other API misuse, blanking the page.
What changed
cps/kobo_auth.py— replace the join-with-duplicates + lazy-load pattern with a singlejoinedload(Books.data)query. One round trip, no lazy loads, no duplicates. Short-circuits whenconfig_kepubifypathis unset (no need to walk the library at all). Wraps each per-bookconvert_book_formatenqueue intry/exceptso one bad book never blank-pages the entire flow.tests/smoke/test_kobo_auth_eager_load_smoke.py— 5-test regression suite that pins the structural change so a refactor can't reintroduce the lazy-load pattern.