node-sonos-discovery icon indicating copy to clipboard operation
node-sonos-discovery copied to clipboard

No Metadata when browsing SQ:4

Open neophob opened this issue 6 years ago • 3 comments

Hi

browsing SQ:4 does not return any metadata, for example:

> p.browseAll('SQ:4').then((res)=>console.log(res));
Promise { <pending> }
> [ { uri: 'x-sonos-http:track%3a235766083.mp3?sid=160&flags=8224&sn=7',
    title: 'R84 PODCAST444: HERZ & KLΔNG',
    artist: 'ROOM84',
    album: undefined,
    albumTrackNumber: undefined,
    albumArtUri: '/getaa?s=1&u=x-sonos-http%3atrack%253a235766083.mp3%3fsid%3d160%26flags%3d8224%26sn%3d7',
    metadata: undefined },
...

compared to another directory:

p.browseAll('FV:2').then((res)=>console.log(res));
Promise { <pending> }
> [ { uri: 'x-sonos-spotify:spotify%3atrack%3a7r539iSTidDcjXjdmvXtFe?sid=9&flags=8224&sn=16',
    title: 'Palace',
    artist: undefined,
    album: undefined,
    albumTrackNumber: undefined,
    albumArtUri: 'https://i.scdn.co/image/3fbbec43f3d052ea25b2ca4c3dc7bda180d28eb2',
    metadata: '<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:.... <snip>

when you want to queue/play a track from SQ:4 no metadata is visible on Sonos but only garbage like x-sonos-spotify:spotify%3atrack%3a7r5.... I found out that SQ:4 does not include metadata in the answer (no r:resMD). However when we attach the original xml as metadata itself, the metadata are correctly visible on Sonos.

I did an ugly workaround for the legacy version here: https://github.com/neophob/node-sonos-discovery/commit/46117dde6a52a7df67cac0261f13e576cbf7595d

neophob avatar Dec 22 '17 13:12 neophob

What exactly is SQ:4? I don't remember ever seeing that. each queries have two different modes one can use, there might be required to send one or the other for this specific query (BrowseMetadata vs BrowseDirectChildren)

jishi avatar Jan 08 '18 14:01 jishi

SQ:4 is the SONOS Playlist, which is the only list I saw without embedded metadata.

neophob avatar Jan 08 '18 19:01 neophob

Hm, okay so SQ: gives you a list of all playlists, and SQ:4 is your fifth playlist, in order it seems. But I get metadata for my SQ:0 and SQ:1, and the tracks in those playlists are from Spotify. What kind of tracks do you have in your SQ:4? Do your other playlists have metadata?

jishi avatar Jan 08 '18 23:01 jishi