Repository navigation
Support the demo's milkdropPresetUrl query param - #1390
Open
captbaritone wants to merge 1 commit into
Open
captbaritone wants to merge 1 commit into
captbaritone wants to merge 1 commit into
Conversation
?milkdropPresetUrl= threw "We still need to implement this". Fetch the .milk file and convert it with the preset converter the demo already uses for dropped .milk files. Like the other preset URL params, only known hosts are accepted: archive.org's md_ items, which already appear in the allowlist for .json presets. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Size Change: 0 B Total Size: 491 kB ℹ️ View Unchanged
|
✅ Deploy Preview for tourmaline-kringle-c98715 canceled.
|
This branch has not been deployed
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.
Links of the form
webamp.org/?milkdropPresetUrl=https://archive.org/cors/md_….milk/….milkfail:getPresetsthrewError: We still need to implement this, so the Milkdrop window opens with no presets. In Sentry this is WEBAMP-1P0, 186 events, and every event since November 2 has an archive.orgmd_URL. Something is linking to webamp.org with these.This implements the param. It fetches the
.milkfile and converts it withmilkdrop-preset-converter-awsand the shader-converter endpoint, the same path the demo already uses for.milkfiles dropped onto Milkdrop. Conversion is lazy (getButterchrunPresetObject), so the converter chunk only loads when the preset is used.As with
butterchurnPresetUrlandbutterchurnPresetMapUrl, only known URLs are accepted, because a converted preset contains code that is run. The allowlist ishttps://archive.org/cors/md_….milk, which mirrors the archive.orgmd_….jsonentry already in the list. Any other URL logsUnsupported URL passed as milkdropPresetUrl query param.and falls back to the default presets. That is the same thing the other params do.importConvertPresetand the converter endpoint move to module-level constants, sobutterchurnOptionsand the new loader share them.Steps to reproduce (on webamp.org today)
Error: We still need to implement thisand Milkdrop has no presets.Test plan
RESOLVEDpreset withwarpandcompshaders, it renders once a track plays, and the console has no errors./?milkdropPresetUrl=https://example.com/foo.milkand check that it logs the "Unsupported URL" error and loads the default presets.eslintandprettier --checkpass. The demo'stscerrors are unchanged: the two existing PNG-import errors inDemoDesktop.tsx.🤖 Generated with Claude Code