code wiki / (root) / nx_mvault_context.nx

nx_mvault_context.nx

buildroot/runtime/nx_mvault_context.nx

3000 B72 linesdepth 5pulls 5 transitivereach 5 importersview sourcekind librarytopic mvault
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_media_pool.nx nx_mvault_ingest.nx nx_mvault_context.nx nx_mvault.nx nx_mvault_context_gate.nx nx_mvault_reindex.nx nx_mvault_reindex_gate.nx nx_mvault_walk.nx

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

23const MV_CTX_NONE: i64 = 0 // no context -> per-file sniff decides
24const MV_CTX_PDF: i64 = 1 // %PDF -> book
25const MV_CTX_EPUB: i64 = 2 // .epub (zip) -> book
26const MV_CTX_CBZ: i64 = 3 // comic zip -> manga
27const MV_CTX_CBR: i64 = 4 // comic rar -> manga
28const MV_CTX_IMGSEQ: i64 = 5 // page N of a numbered image gallery -> manga

functions

33func mv_is_pdf(b: *u8, n: i64) -> i64
called by 2: mv_ctx_frommain
43func mv_is_zip(b: *u8, n: i64) -> i64
called by 2: mv_ctx_frommain
53func mv_is_rar(b: *u8, n: i64) -> i64
called by 2: mv_ctx_frommain
65func mv_context_type(sniff_type: i64, ctx: i64) -> i64