feat: accept .amf in module allowlist#45
Merged
Conversation
libopenmpt already decodes Asylum Music Format V1.0 (Amiga) and DSMI Advanced Module Format (PC); both share the .amf extension and are distinguished by content. Smoke test: a real .amf renamed to .mod played cleanly through the existing libopenmpt path. The bottleneck was purely the extension allowlist — no new engine, worklet, or wasm build needed. Widens MODULE_EXTENSIONS (transitively widens local drag-drop and the pages/api/library/* server allowlists via isModuleFile) and extends the Amiga-style filename rewriter with an .amf entry plus the self-identity alias matching the pattern every other native extension follows. Assisted-by: ClaudeCode:claude-opus-4-7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.amf. The bundled wasm decodes them already — the only blocker was the extension allowlist.MODULE_EXTENSIONSso.amfsurfaces from Local drag-drop and the Library API (pages/api/library/*consumeisModuleFilefromcomponents/sources, so this single edit covers client + server)..amfentry plus the self-identity alias matching the pattern every existing native extension follows (idempotency, double-form collapse, case canonicalization all verified by walking the algorithm).No new engine, worklet, magic-byte sniff, or wasm rebuild. Asylum AMF V1.0 magic (
"ASYLUM Music Format V1.0"at offset 0) does not collide with the AHX/THX 4-byte prefix sniff, so the existing magic-dispatch inAudioPlayer.play()falls through to libopenmpt correctly.Test plan
.amfto.mod, drop into Local — confirmed plays through libopenmpt.make typecheck— clean.make test— 125 passed..amf(non-renamed) into Local — verify it surfaces as a row and plays.LIBRARY_ROOTis configured: place a.amfunder it and verify/api/librarysurfaces it and/api/library/fileserves it.toAmigaStyle("Song.amf")→"amf.Song"andtoAmigaStyle("amf.Song")→"amf.Song"(idempotent).Known non-regressions (out of scope)
sniffDownloadExtensionfalls back to.modfor.amfdownloads. This is pre-existing for every non-AHX format (.xm,.it,.s3m, …); fixing it for all of them is a separate change.