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);
// fix sortKey and index properties
var nextSortKey = keese(null, null);
this.tracksInOrder.forEach(function(track, index) {
track.index = index;
for (var i = 0; i < this.tracksInOrder.length; i += 1) {
var track = this.tracksInOrder[i];
track.index = i;
track.sortKey = nextSortKey;
this.persistPlaylistItem(track);
nextSortKey = keese(nextSortKey, null);
});
}
playlistChanged(this);
};