Skip to content
Snippets Groups Projects
Commit 9929edba authored by ale's avatar ale
Browse files

hopefully fix addChunk / 3

parent bf3670aa
No related branches found
No related tags found
No related merge requests found
...@@ -112,15 +112,16 @@ djr.Playlist.prototype.allSongs = function() { ...@@ -112,15 +112,16 @@ djr.Playlist.prototype.allSongs = function() {
// Returns the chunk ID, or -1 if no songs were added. // Returns the chunk ID, or -1 if no songs were added.
djr.Playlist.prototype.addChunk = function(playlist_chunk) { djr.Playlist.prototype.addChunk = function(playlist_chunk) {
djr.debug('adding chunk to playlist ' + this.uuid); djr.debug('adding chunk to playlist ' + this.uuid);
chunk_id = this.next_chunk_id++; var chunk_id = this.next_chunk_id++;
var songs = []; var songs = [], i;
for (i = 0; i < playlist_chunk.songs.length; i++) { for (i = 0; i < playlist_chunk.songs.length; i++) {
var song = playlist_chunk.songs[i];
if (this.song_map[song]) { if (this.song_map[song]) {
continue; continue;
} }
songs.push(playlist_chunk.songs[i]); songs.push(song);
this.song_map[playlist_chunk.songs[i]] = chunk_id; this.song_map[song] = chunk_id;
} }
if (songs.length == 0) { if (songs.length == 0) {
...@@ -183,7 +184,9 @@ djr.Player = function(backend, selector) { ...@@ -183,7 +184,9 @@ djr.Player = function(backend, selector) {
// Setup the jPlayer interface. // Setup the jPlayer interface.
this.player.jPlayer({ this.player.jPlayer({
ready: function() {}, ready: function() {
djr.debug('player ready');
},
}); });
this.player.bind($.jPlayer.event.ended + '.djr', this.player.bind($.jPlayer.event.ended + '.djr',
function () {djr.state.player.nextSong(); }); function () {djr.state.player.nextSong(); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment