Skip to content

Normalizer: an option to write named library folders after the media #148

Closed

Description

@alekswebnet

normalizeArchive sorts every library folder before content/, with the media last (orderEntries). That is the right order for what plays. It is the wrong one for libraries a package carries and nothing reads as it plays: the editor libraries an H5P site's upload check asks for, which h5p-author's packages and the demo's now carry (#146, #147).

In a package with media they end up before content/content.json, so a host that ignores Range has to deliver them before the frame can boot. On the demo's video (an Interactive Video, 5.2 MB with them) the content now ends at 4.1 MB; without them it ended at 1.5 MB. A package without media keeps the order h5p-author writes, libraries, content, then these, because h5p-author normalizes only a package that has media. So only packages with media are affected, and Interactive Video and Course Presentation are the ones whose editors are large.

Proposal

normalizeArchive({ input, output, last }): last is a list of top-level folders written after everything else, the media included, each whole and in the order the source had them. content is never moved, a name the archive has no folder for is ignored, and a string is refused rather than read as letters. Without last nothing changes, so it is a minor. No command-line flag: only the package's author knows which folders those are.

Plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions