Fixed behavior of play now/next on empty tracklist

removed getTracks() call
This commit is contained in:
dmosen 2015-10-22 21:19:36 +02:00 committed by Nick Steel
parent ded5192b3b
commit aa7b0a59da

View File

@ -36,13 +36,13 @@ function playBrowsedTracks(action, trackIndex) {
switch (action) { switch (action) {
case PLAY_NOW: case PLAY_NOW:
case PLAY_NEXT: case PLAY_NEXT:
mopidy.tracklist.index(songdata).then(function(currentIndex) { var maybePlay = function(tlTracks) {
var addFunc = mopidy.tracklist.add(null, currentIndex + 1, null, trackUris); if (action === PLAY_NOW) {
if (action == PLAY_NOW) { mopidy.playback.play(tlTracks[0]);
addFunc.then(function(tlTracks) { }
mopidy.playback.play(tlTracks[0]); };
}); mopidy.tracklist.index().then(function (currentTrack) {
}; mopidy.tracklist.add(null, currentTrack + 1, null, trackUris).then(maybePlay);
}); });
break; break;
case ADD_THIS_BOTTOM: case ADD_THIS_BOTTOM: