diff --git a/includes/js/ajax.playlist.shuffle.js b/includes/js/ajax.playlist.shuffle.js index 79f6d21..d23087b 100644 --- a/includes/js/ajax.playlist.shuffle.js +++ b/includes/js/ajax.playlist.shuffle.js @@ -50,6 +50,7 @@ function ajax_no_shuffle($) { $("#player56s-no-shuffle").html(data); $("#player56s-shuffle").html('0'); $(".player56s").player56s($); + $("#player56s-no-shuffle").empty(); }, error: function(errorThrown){ //error stuff here.text diff --git a/public/js/player56s.js b/public/js/player56s.js index 336ff52..04dae04 100644 --- a/public/js/player56s.js +++ b/public/js/player56s.js @@ -404,8 +404,10 @@ jQuery( function player56s($) { currentTrack = player56sInstance.tracks[player56sInstance.currentTrack]; player56sInstance.tracks.forEach(function(element_, index) { player56sInstance.tracks.forEach(function(element, index_) { - if ( playlist_no_shuffle[index_].innerHTML == player56sInstance.tracks[index].postid ) { - tracks[index_] = player56sInstance.tracks[index]; + if (playlist_no_shuffle[index_].innerHTML !== undefined) { + if ( playlist_no_shuffle[index_].innerHTML == player56sInstance.tracks[index].postid ) { + tracks[index_] = player56sInstance.tracks[index]; + } } }); });