jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Unable to play artists from Spotify #762

Closed kaarthikalagappan closed 4 years ago

kaarthikalagappan commented 4 years ago

Hello!

I'm trying to play an artist from Spotify using the artist's URI (of the format spotify:artist:3YQKmKGau1PzlVlkL1iodx), but I'm getting an error whenever I try to invoke it with this syntax: http://localhost:5005/ZONE/spotify/now/spotify:artist:3YQKmKGau1PzlVlkL1iodx

The error I get is:

Error: Got status 500 when invoking /MediaRenderer/AVTransport/Control
    at Object.invoke (/home/pi/node-sonos-http-api/node_modules/sonos-discovery/lib/helpers/soap.js:99:10)
    at Player.addURIToQueue (/home/pi/node-sonos-http-api/node_modules/sonos-discovery/lib/models/Player.js:616:15)
    at promise.then (/home/pi/node-sonos-http-api/lib/actions/spotify.js:36:33)

I tried to change the parameter to http://localhost:5005/ZONE/spotify/now/spotify:user:spotify:artist:3YQKmKGau1PzlVlkL1iodx and it still didn't work.

I'm able to play albums, playlists, and tracks through the API, just not artists.

jishi commented 4 years ago

Probably because artists doesn't have an explicit song list to begin with. It's just a URI pointing to an artist page in Spotify. The notion of top tracks is something else. I haven't looked into how the top tracks are dealt with in regards to Spotify, or if it is possible.

kaarthikalagappan commented 4 years ago

Got it. Thank you for this amazing API!