bencevans / node-sonos

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

Trying to get the a favorite selection to work #507

Closed Lucker25 closed 3 years ago

Lucker25 commented 3 years ago

Hi everyone,

I`m right now trying to build a small dashboard based on the MagicMirror Project. I tried adding touch controls a small controller. Everything like, play, pause etc. was working perfectly and then I tried adding a favorite selection as in the picture below. image

Getting the Favorites works perfectly fine, but then playing the favorites is a completly different story...

On selection of an element I´m getting an object like this: { album: null albumArtURI: "https://images-na.ssl-images-amazon.com/images/G/01/ctt2309d82309/A1MIPILDQJQDR2_2400x2400_DE_BestOfPopRocks_Pop_PG_SA_DN.jpg" artist: null id: "2/31" parentID: "2" title: "Best Of Pop & Rock" uri: "x-sonosapi-radio:catalog%2fstations%2fA1MIPILDQJQDR2%2f%23chunk-mg4 }

When trying to set the object via the sonos.play() function it´s only working for tune in streams, but not for spotify. I´ve also tried to flush my queue, dann set the metadata object as new queue and play that (that was recommened in another issue from some time ago). But that isn´t helping either...

What am I doing wrong? Does anyone have an idea?

Best regards Lucker25

if someone is interested in the source code it´s in: https://github.com/Lucker25/MMM-SonosController/blob/629071133164559c99134539a3af3c1c8a9d410c/node_helper.js#L52-L64

EDIT: For now I don´t know how to get this to work with the node sonos. But I´m using the http sonos api (https://github.com/jishi/node-sonos-http-api) for another module. Combining both modules works right now for me. Though I know this is just a workaround

Node version: 10.23.1 node-sonos version: 1.14.0 OS: Linux (Raspbian)