github new-usemame/Calibre-Web-NextGen v4.0.76
v4.0.76 — duplicate scans 100× faster (CWA #1353 by @navels)

11 hours ago

What's new

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

(or `:latest`)

Duplicate detection rewritten — works on large libraries now

If you've got 10,000+ books, the Duplicates page used to take 30+ seconds to load and could pin a CPU while it rebuilt duplicate groups from scratch every time. Each import or metadata edit invalidated the cache and triggered another full scan.

After upgrading, the first time you open Duplicates you'll see a one-time notice asking you to Run Full Duplicate Scan. Click it once — that builds the index from your library. After that, imports update the index in milliseconds instead of rescanning your whole library. The duplicate-count badge in the sidebar updates instantly. The "Preview Resolution" dialog now opens as a proper modal showing exactly which books will be kept and which deleted, instead of a system alert popup.

What changed under the hood

  • New cwa_duplicate_book_keys SQL table keeps the normalized title + author + format signature for every book. Duplicate detection just queries the index.
  • Per-book incremental updates on every import, metadata edit, and deletion — no more full-library rescan.
  • Ingest and manual scans now coordinate: imports wait briefly if you triggered a manual scan, and manual scans block during active import. No more racing.
  • Resolution Preview is a real Bootstrap modal with KEEP / DELETE breakdown per book.

Fork preservation

This backport preserves all the existing fork-specific reliability work:

  • Metadata.db file-lock for mergerfs / SMB / NFS users (fork issue #192)
  • The 30-second after-import debounce with 10-second floor (PR #210)
  • SQLite UDF connect-event listener that eliminated the GIL+SQLite deadlock (PR #212)
  • Ingest worker s6-setuidgid abc privilege drop (PR #37 / #56)
  • Fast-exit on missing ingest paths from v4.0.75

Credits

Thanks @navels for the original work in CWA #1353.

If you hit something broken, open an issue on this repo and we'll look at it.

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

NewReleases is sending notifications on new releases.