Repository navigation
Add updateTrack instance method - #1381
Open
captbaritone wants to merge 2 commits into
Open
captbaritone wants to merge 2 commits into
captbaritone wants to merge 2 commits into
Conversation
|
Size Change: +257 B (+0.05%) Total Size: 491 kB 📦 View Changed
|
✅ Deploy Preview for tourmaline-kringle-c98715 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
captbaritone
force-pushed
the
update-track
branch
3 times, most recently
from
October 15, 2026 17:00
2fe5ff2 to
5852b59
Compare
Allow embedders to rename a track, or replace its metadata, without reloading it. defaultName is set with a new SET_TRACK_DEFAULT_NAME action; metaData reuses SET_MEDIA_TAGS, which preserves the track's kbps/kHz/channels.
captbaritone
force-pushed
the
update-track
branch
from
October 15, 2026 17:21
5852b59 to
23b9c98
Compare
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.
There's currently no way to change a loaded track's name or metadata, short of replacing the whole playlist (which reloads the audio). The agentcloud requirements doc lists this as a nice-to-have ("Allow updating a loaded track's
defaultNameormetaData") without stating a use case. The likely one is an embedder whose track name changes after loading, e.g. a renamed file.This adds:
indexis the track's position in the playlist, the same ordergetPlaylistTracks()returns, and is resolved to the internal track id. An out-of-range index throws.defaultName: set with a newSET_TRACK_DEFAULT_NAMEaction.metaData: reuses the existingSET_MEDIA_TAGSaction, which keeps the track's kbps/kHz/channels. It replaces any metadata the track already has, including metadata read from the file's tags. Note that the playlist shows "artist - title" in preference todefaultNamewhen a track has metadata.The update shape is
Pick<Track, "defaultName" | "metaData">, so it matches theTrackobjects embedders already pass in. Documented in the instance methods docs.Unrelated, but noticed while here:
setCurrentTrack(index)passesindextoplayTrack, which expects a track id. Since ids are generated unique ids rather than positions, that looks like a bug. I've left it alone in this PR.Testing
updateTrack.test.ts(with a fake media class via__customMediaClass) checks that updatingdefaultNameormetaDataonly affects the targeted track, and that a missing index throws.tsc,eslint,prettier --checkandvitest runpass locally.