persist queue on shuffle. closes #190

This commit is contained in:
Andrew Kelley 2014-04-10 09:50:13 -07:00
parent cc7183ce53
commit 259f247290

View file

@ -925,11 +925,13 @@ Player.prototype.shufflePlaylist = function() {
shuffle(this.tracksInOrder); shuffle(this.tracksInOrder);
// fix sortKey and index properties // fix sortKey and index properties
var nextSortKey = keese(null, null); var nextSortKey = keese(null, null);
this.tracksInOrder.forEach(function(track, index) { for (var i = 0; i < this.tracksInOrder.length; i += 1) {
track.index = index; var track = this.tracksInOrder[i];
track.index = i;
track.sortKey = nextSortKey; track.sortKey = nextSortKey;
this.persistPlaylistItem(track);
nextSortKey = keese(nextSortKey, null); nextSortKey = keese(nextSortKey, null);
}); }
playlistChanged(this); playlistChanged(this);
}; };