I have a simple spotify (JS) app and I want to either:
- Create a new playlist with the first track and play it, or
Append the song to the currently playing playlist
var playlist = new models.Playlist(); ... var search = new models.Search(query); search.observe(models.EVENT.CHANGE, function() { if (search.tracks.length) { var track = search.tracks[0]; playlist.add(track); if (!models.player.playing) models.player.play(track, playlist); } }); search.appendNext();
Shouldn't this simply append the new track to the existing playlist? (playlist is scoped higher up, and it is definitely not re-created each time).
Currently nothing happens when a track is playing.