feat(tracks): make ID3 tag query params opt-in via ?id3=true#808
Merged
Conversation
Stream and preview URLs returned by track endpoints unconditionally included id3=true&id3_artist=...&id3_title=... query params. Those params force the validator node to proxy bytes server-side so it can prepend an ID3v2 tag, which bypasses the new presigned-blob-storage redirect path on validator nodes with OPENAUDIO_BLOB_STORAGE_STREAMING enabled. Make ID3 tag injection opt-in: callers that need it (e.g. download or share flows that hand the raw URL to a non-browser player) pass ?id3=true; web players that render their own metadata get the default no-id3 URLs and benefit from presigned redirects. Implementation reuses the c.Locals -> ctx.Value bridge established by solanaWalletMiddleware: a tiny middleware reads ?id3=true and stashes a bool, and dbv1.TracksKeyed gates id3Tags construction on it. No handler thread-through needed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
id3=true&id3_artist=...&id3_title=...unconditionally. Those query params force validator nodes to proxy the audio bytes server-side so they can prepend an ID3v2 tag, which bypasses the presigned-blob-storage redirect path that runs on validator nodes withOPENAUDIO_BLOB_STORAGE_STREAMING=true.?id3=truegets a URL with the id3 params (server proxies, tag injected); any other request gets a URL without them (validator can redirect straight to a presigned object-storage URL).c.Locals→ctx.Valuebridge used bysolanaWalletMiddleware. A tiny middleware reads?id3=trueand stashes a bool on the request context;dbv1.TracksKeyedgates theid3Tagsconstruction on it. No handler thread-through needed — the param works on every endpoint that returns tracks (single track, listings, search, trending, playlists, feed, etc.).Why
The current behavior is the default that was wired up in #272 / AudiusProject/audiusd#152 — those PRs framed it as scaffolding for a future DDEX-driven flow on the validator side, with no recorded product requirement that ID3 must be in the byte stream for every stream/preview URL.
For web players that render their own metadata (and use
MediaSessionfor OS-level "now playing"), the ID3 tag in the byte stream is unused — and now actively harmful because it forces the validator to skip presigned redirects. Making it opt-in lets those callers dropid3=trueand get presigned redirects today, while download/share flows that hand the raw URL to non-browser players can keep it.Test plan
go build ./...passesgo vet ./...passesmake test(couldn't run locally — port 21300 held by an unrelated container)?id3=true, confirm 307 to a presigned blob URL; hit again with?id3=true, confirm proxied bytes with ID3 tag intact🤖 Generated with Claude Code