diff --git a/server/djrandom/frontend/static/player.js b/server/djrandom/frontend/static/player.js index 1bc9d6e754a1809d189616c2d6af04104ccb1239..fe4d0778bfcbeb62080bd87adab891554a72d551 100644 --- a/server/djrandom/frontend/static/player.js +++ b/server/djrandom/frontend/static/player.js @@ -225,7 +225,19 @@ djr.Player.prototype.removeChunkCallback = function() { }; djr.Player.prototype.mergePlaylistChunks = function() { + // Reduce the playlist to a single chunk. this.playlist = this.playlist.merge(); + + // Shuffle the HTML data around (so we don't have to necessarily + // fetch it again from the server). + $('.chunk').each(function(idx, element) { + if (idx > 0) { + $('#chunk_0').append(element.html()); + element.remove(); + } + }); + $('#chunk_0 .chunk_title').text( + this.playlist.chunk_map[this.playlist.chunks[0]].title); }; // Search!