nx_mvault_context.nx
buildroot/runtime/nx_mvault_context.nx
about
nx_mvault_context.nx -- CONTEXTUAL ingestion: type from surrounding context,
not just per-file magic bytes.
WHY (operator 2026-07-17): "ingest ... hentai formats or other things that
may look like images but really be books ... the ingestion to be contextual."
A numbered image sequence in a gallery/doujin dir is ONE book, not N loose
images; a .cbz/.cbr is a comic; a .pdf/.epub is a book. The per-file sniffer
(nx_media_sniff) sees only bytes -- it would file every doujin page as a
separate loose IMAGE. This layer applies the CONTEXT the reindexer computes
(archive magic, in-a-numbered-sequence, ebook) to fold them into one work.
The reindexer computes a ctx flag per item (from dir scan + these magic
detectors + extension) and calls mv_context_type; a whole image-sequence
dir becomes ONE MANGA item (its pages are members, not separate items).
Composes nx_mvault_ingest (mv_type / MV_TYPE_*). license_tier: ORIGINAL
dependencies 3 imports · 5 importers
imports: nx_syscalls.nxnx_media_pool.nxnx_mvault_ingest.nx
imported by: nx_mvault.nxnx_mvault_context_gate.nxnx_mvault_reindex.nxnx_mvault_reindex_gate.nxnx_mvault_walk.nx
structs
| none |
consts
| 23 | const MV_CTX_NONE: i64 = 0 // no context -> per-file sniff decides |
| 24 | const MV_CTX_PDF: i64 = 1 // %PDF -> book |
| 25 | const MV_CTX_EPUB: i64 = 2 // .epub (zip) -> book |
| 26 | const MV_CTX_CBZ: i64 = 3 // comic zip -> manga |
| 27 | const MV_CTX_CBR: i64 = 4 // comic rar -> manga |
| 28 | const MV_CTX_IMGSEQ: i64 = 5 // page N of a numbered image gallery -> manga |
functions
| 33 | func mv_is_pdf(b: *u8, n: i64) -> i64 |
| 43 | func mv_is_zip(b: *u8, n: i64) -> i64 |
| 53 | func mv_is_rar(b: *u8, n: i64) -> i64 |
| 65 | func mv_context_type(sniff_type: i64, ctx: i64) -> i64 |