Skip to content

fix(build): a single file of a kind is taken whatever it is called, and a file that is not used is said (#94) - #95

Merged
alekswebnet merged 2 commits into
mainfrom
fix/build-files-by-kind
Nov 23, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
fix/build-files-by-kind

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #94.

On the build page, picking a video did nothing unless the file was called exactly what the source calls it. Now a single file of the right kind is taken whatever it is called, and a file that is not used is said, with why.

What changes

  • One rule for both pages, in build-source.ts's matchNamed, which matchFiles is for files and the play page's linksFor is for addresses: by name first; then, where one path of a kind (.mp4) is left without its file and one chosen file of that kind is left without a path, that is its file. With more of a kind on either side, names decide as before. The play page's own copy of the rule is gone; it uses this one.
  • The row says which file was taken where its name is not the source's: "chosen: IMG_0042.mp4, 2.1 MB".
  • A file picked again for that path replaces the one before, whether either is called as the source calls it or not.
  • A picked file that no path takes is said under the list: "notes.pdf is not used: the source names no file of that kind.", or, with several of a kind, that each has to be called as the source calls it.
  • The step's line says so too: "Each is matched by its name, and a single file of a kind fits whatever it is called."

Testing

By hand, as this repository has no page tests: the built site served locally, a source that names walkthrough.mp4, files picked through the page's own field.

Picked Before (the live page) Now
IMG_0042.mp4 "not chosen yet", nothing said; Build: "The source has 1 problem" "chosen: IMG_0042.mp4, 2.1 MB"; Build: built, 6.3 MB, plays
then second take.mp4 replaces it
then notes.pdf "notes.pdf is not used: the source names no file of that kind."
then walkthrough.mp4 "chosen, 2.1 MB" "chosen, 2.1 MB", and the one before goes
two unnamed videos at once neither taken, and why is said

Not verified

  • Chromium only.
  • A source that names several files of one kind was not run through the page; the rule leaves those to their names, as before.

Summary by cubic

Fixes the build page so a single file of the right kind is taken whatever it's called, and files that end up unused are explained.

The build page only matched picked files to source paths when names were identical, so a video named by a camera or chat stayed "not chosen yet" and no reason was given. One rule now lives in build-source.ts's matchFiles, used by both the build and play pages: match by name first, then a single file of a kind fits a single path of that kind.

  • Rows name the file taken when its name differs from the source's.
  • A file picked again for the same path replaces the previous one.
  • Picked files no path takes are listed with the reason.
  • The play page now uses the shared rule instead of its own copy.

Written for commit 5322749. Summary will update on new commits.

View guided diff Turn on auto-fix

…nd a file that is not used is said (#94)

The build page took a picked file only under the exact name the source writes, and said nothing otherwise: a video called what a camera or a chat called it stayed "not chosen yet". The play page already took a single file of the right kind. Both now match by one rule, in build-source: by name, then one path of a kind left without its file with one chosen file of that kind left without a path.

The row names the file taken under another name, a file picked again for that path replaces the one before, and a picked file no path takes is said with why.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/h5p/play/play-page.ts Resolved
…tched by (#94)

The rule moved behind both as matchNamed: by name, then a single one of a kind whatever it is called. An address was still matched by the older, narrower one: only where one path and one address were left in all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: a file picked under another name than the source's is not taken, and nothing says so

1 participant