A book's .opf, comic metadata, cover and page count are all unread #210
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A book is resolved, filed, and given the one second of run time an
.epubgets (crates/ephyra-app/src/scan/run/read.rs:470). Nothing else about it is read. Split out of #194, which covered the resolver.crates/ephyra-app/src/metadata/holdsartwork,audiodb,musicbrainz,omdbandtmdb. Upstream'supstream/MediaBrowser.Providers/Books/holds:OpenPackagingFormat/.opfbeside a book, and the one inside an.epub— title, authors, publisher, series, ISBN, published dateComicImageProvider.cs.cbz/.cbrarchiveComicInfo/,ComicBookInfo/ComicInfo.xmlinside the archive, and the JSON in a.cbzcommentComicVine/,GoogleBooks/,Isbn/The local ones are what matter: they are the difference between a book library that shows filenames and one that shows titles and covers.
Page counts
Neither a comic archive nor a PDF has its page count read (
grep page_count crates/finds only a SQLite pragma). Upstream files it, and it is what a reader client uses for a progress bar.Where to start
crates/ephyra-app/src/scan/tree/books.rs:17already knows the extensions:.azw .azw3 .cb7 .cbr .cbt .cbz .epub .mobi .pdf. An.epuband a.cbzare both zip archives, so the.opfread and the first-page cover share most of their machinery;.cbris rar and is the one that needs a dependency decision.Verifying
cargo xtask reference gen-library-kinds(xtask/src/reference/kinds.rs) already registers abookslibrary and writes upstream's rows intocrates/ephyra-app/corpus/library-kinds.json, replayed bycrates/ephyra-app/tests/library_kinds.rs. The tree's books are empty placeholder files, so this needs real archives carrying a known.opfand a known first page in the fixture before any of it can be diffed against upstream. Building them in the generator keeps them reproducible.Fixed, and landed on
mainat7bbf49e0.What is read
.opfbeside a book, or the one inside an.epub: title, sort title, authors, publisher, series and index, ISBN, date, rating, genres and tags.ComicInfo.xmlbeside a comic or inside a.cbz, and the ComicBookInfo JSON in a.cbzcomment..cbrand.cb7are filed by their name alone. D48 records why.Hostile archives
Every read of an archive is bounded: the zip directory and entry sizes (both uncompressed and stored), the deflate output, tar entries, the PDF tail, cross-reference table and object windows, XML nesting depth, and the
.opf/ComicInfo.xmltext read. The review's crafted inputs are tests now, and each fails without its bound:/Countati64::MAX.Verified
Real EPUB, CBZ, CBT and PDF assets are built reproducibly in
xtask/src/reference/assets.rs. The regenerated library-kinds key records upstream's reading of each.xtask/src/reference/kinds.rscompares our reader to it strictly: title, sort title, overview, rating, genres, studios, tags, date, year, number, series and page count. NFO attribute matching is exact again; only the OPF and comic readers strip a namespace prefix.Filed separately