v1.1.0-beta.075 - fix(opds): issues showed "0 pages" and would not open in OPDS apps (Panels)
🐛 Fixes
- OPDS clients (Panels, Chunky) showed every issue as "0 pages" and refused to open them — the feed advertises pse:count from Issue.pageCount, but only the download importer ever persisted a count; issues indexed by the library scanner, watched-folder sync, Smart Matcher, or issue-link all sat at the schema default of 0
- The web reader masked the bug because it re-lists the archive on every open instead of reading the stored count
⚙️ Changes
- New archive-pages util countArchivePages(filePath): counts readable image pages by parsing only the zip End-Of-Central-Directory + central directory (a ~64KB tail read instead of AdmZip loading the whole archive), with an AdmZip fallback for ZIP64/odd archives; entry filter exactly mirrors the reader and the OPDS page streamer so pse:count always agrees with the indexes they serve; never throws (returns 0)
- Page counts now persisted at every point a file enters or changes: library scanner (new issues), watched-folder sync, Smart Matcher re-match, issue-link, CBR→CBZ conversion (recount after the CBZ exists), and archive repack
- Existing libraries self-heal two ways: the full library scan backfills zero-count issues during its existing per-issue sweep, and the OPDS series feed heals the series being browsed inline (written back, so each archive is read once) — Panels works immediately without waiting for a scan cycle
🧪 Tests
- 5 new archive-pages tests on real zips: reader-filter parity (junk/dirs/__MACOSX excluded, nested images counted), agreement with a full AdmZip parse, zip-comment tolerance, and 0-not-throw for RAR/missing/corrupt archives
- 3 new OPDS series feed tests: persisted count advertised without touching the archive, zero count self-healed from the archive and written back, un-countable CBR left at 0 for the converter
✅ Verification
- tsc clean, vitest 315/315
Co-Authored-By: Claude Fable 5 noreply@anthropic.com