Page MenuHomePhabricator

Determine how to embed metadata into zim files
Closed, ResolvedPublic2 Estimated Story Points

Description

Instead of hand typing information into a static JSON dictionary for each compilation, we should figure out how to embed all metadata for each Zim file into the file itself during generation time.

This includes the images for displaying within the app.

The metadata to embed is here T163586: Develop the content packs endpoint response schema

After this is embedded, then we need to be able to run a process to generate the the full JSON that contains all metadata for all available compilations. This will be hosted in the MCS.

Note: file size will be impossible to embed in the file (since the JSON will be ), and unnecessary since it can be determined from the file itself.

Note 2: In order to generate the full JSON list, the process needs to know where all compilations are located so it can find them deterministically. This may mean some sort of known path in swift.

Event Timeline

Per discussion with @Dbrant, we actually already know how to include arbitrary content in a ZIM file, generally speaking: a ZIM file is fundamentally a collection of arbitrary binary blobs, indexed by their filenames in the source directory it's written from.

Specifically for new file metadata fields (such as a separate, longer file description field), if we need this, it would require proposing (fairly simple) changes upstream to zimwriterfs (and then mwoffliner) to handle the additional field(s).