Skip to content
Snippets Groups Projects
Commit 941b1742 authored by ale's avatar ale
Browse files

hopefully fix addChunk

parent b710a1b0
No related branches found
No related tags found
No related merge requests found
...@@ -114,12 +114,13 @@ djr.Playlist.prototype.addChunk = function(playlist_chunk) { ...@@ -114,12 +114,13 @@ 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++; chunk_id = this.next_chunk_id++;
var songs = []; var songs = [];
var playlist = this;
$.each(playlist_chunk.songs, function(idx, song) { $.each(playlist_chunk.songs, function(idx, song) {
if (this.song_map[song]) { if (playlist.song_map[song]) {
return; return;
} }
songs.push(song); songs.push(song);
this.song_map[song] = chunk_id; playlist.song_map[song] = chunk_id;
}); });
this.chunk_map[chunk_id] = new djr.PlaylistChunk(songs); this.chunk_map[chunk_id] = new djr.PlaylistChunk(songs);
this.chunks.push(chunk_id); this.chunks.push(chunk_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment