Skip to content

fix: reset context metadata when loading a new context#329

Draft
plisker wants to merge 3 commits into
devgianlu:masterfrom
plisker:fix/stale-context-metadata
Draft

fix: reset context metadata when loading a new context#329
plisker wants to merge 3 commits into
devgianlu:masterfrom
plisker:fix/stale-context-metadata

Conversation

@plisker

@plisker plisker commented Jul 13, 2026

Copy link
Copy Markdown

What

Reset PlayerState.ContextMetadata when loading a new context in loadContext, instead of merging the new context's metadata into the map left over from the previous one.

Why

When switching from one context to another (e.g. starting an album while a different album is playing), every field of the new context — SessionId, ContextUri, ContextUrl, Restrictions, tracks — is replaced, but ContextMetadata was only merged. Keys the previous context set that the new one omits therefore survived. Most visibly, context_description lingered, so Spotify's queue kept showing "Next from: <previous album>" while the correct track played.

The transfer path in daemon/player.go already resets the map before copying; this brings loadContext in line. The same-URI update_context path still merges, which is correct there.

Test plan

  • go build -v -o /dev/null ./cmd/daemon
  • gofmt -l . clean
  • On-device: play album A, start a track from album B, confirm the queue header reads album B.

Closes #330

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.

Stale context metadata: "Next from:" shows the previous context after loading a new one

1 participant