Skip to content

Conversation

@samhatts
Copy link

Motivation

  • Sonos queue parsing only resolved Spotify URIs so tracks from YouTube Music could not be displayed as full track objects in the app.
  • The change aims to detect service-specific track references in queue items and resolve metadata via the correct music service so YouTube Music items appear in the queue.

Description

  • Parse queue entries from both ItemId and TrackUri, decode URI components, and extract service-specific references using a regex that matches spotify, youtube, and ytmusic URIs in QueueProvider and call getTrack with a detected service id.
  • Add YouTubeMusic = 233 to the Services enum and detect service id from sid query param or by matching youtube|ytmusic in URIs in QueueProvider.
  • Extend Sonos metadata helpers in SonosContext to accept an optional service parameter and prepend the service to cache keys so metadata is cached and retrieved per service, and use the provided service when calling sonos.GetItemMetadata/GetMetadata.
  • Update call sites in the queue mapping to request track metadata with the detected service so YouTube Music tracks are resolved to TN_Track objects and included in the UI.

Testing

  • No automated tests were run on these changes.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants