andrehaveman / spotify-node-applescript

Control Spotify on Mac OSX with NodeJS and AppleScript
MIT License
316 stars 38 forks source link

Feature Request #30

Closed alxkski closed 8 years ago

alxkski commented 8 years ago

Hi there! Just got this setup and running and it works great, thanks for making this. This isn't an issue, more a feature request. Is there any way of adding the option to add a song to the current playlist queue. In Spotify it's called "Add to Queue". Would make playlist collaboration in the office great!

Thanks,

Alex

andrehaveman commented 8 years ago

That would be great, but I don't see any option for that in the AppleScript API of the Spotify app. So I don't see any possibility to make this.

kabirvirji commented 7 years ago

@alxkski what you could do is use the Spotify API to search for the song you want to play, and also get its time duration (which is in the JSON response). You can push that song uri to an array, and have a function that checks every second (using spotify.getState) to see if the time you got from the API response is equal to the position from spotify.getState. If it is, play the next song in the array (which you have the uri for) Does that make sense?

sampurcell93 commented 7 years ago

@kabirvirji From the spotify docs: "Due to a known issue it is not currently possible to retrieve the player position."