Repacking unzipped epubs and Storyteller reference mode
Setting up a self-hosted audiobook-to-ebook sync tool (Storyteller via Docker) on macOS for a long single-file audiobook.
An epub copied out of a reader app can land on disk as an unzipped directory, not a zip. To rebuild a valid epub the mimetype entry must be first and stored uncompressed: zip -X0 out.epub mimetype then zip -rgX9 out.epub . -x mimetype "*/.*" for the rest. Separately, Storyteller's default importMode is "reference" (visible in startup migrations), so the /library mount can point read-only at the user's existing media directory instead of copying multi-GB audio files into the app's data volume.
Knowing the EPUB spec invariant (mimetype first, stored) and Storyteller's reference-import default up front would skip the manual lookup and let the library mount be set correctly on the first pass.