bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
704 stars 147 forks source link

CurrentTrack event and BBC Sounds statioins #532

Open kimaldis opened 2 years ago

kimaldis commented 2 years ago

Using the CurrentTrack event to watch for track changes, when a BBC station plays the returned data has changed since BBC stations now have to be accessed through the BBC Sounds service. I wondered, is there a way to get title, artist, album data where available when these tracks change.

Radio 4:

{
  id: null,
  parentID: null,
  title: 'BR P|TYPE=SNG|TITLE |ARTIST |ALBUM ',
  artist: null,
  album: null,
  albumArtist: null,
  albumArtURI: 'https://ichef.bbci.co.uk/images/ic/640x640/p0c0bzb3.jpg',
  uri: 'x-sonosapi-hls:stations%7eplayable%7e%7ebbc_radio_fourfm%7e%7eurn%3abbc%3aradio%3anetwork%3abbc_radio_four?sid=325&flags=288&sn=6',
  duration: 0,
  queuePosition: 1
}

Radio 2 - track changes every ten seconds or so, reflects what the station is currently playing:

{
  id: null,
  parentID: null,
  title: 'BR P|TYPE=SNG|TITLE Vogue|ARTIST Madonna|ALBUM ',
  artist: null,
  album: null,
  albumArtist: null,
  albumArtURI: 'https://ichef.bbci.co.uk/images/ic/640x640/p01bv8jj.jpg',
  uri: 'x-sonosapi-hls:stations%7eplayable%7e%7ebbc_radio_two%7e%7eurn%3abbc%3aradio%3anetwork%3abbc_radio_two?sid=325&flags=288&sn=6',
  duration: 0,
  queuePosition: 1
}