Skip to content

Commit

Permalink
Fix when the no shuffle value is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerl92 committed Aug 27, 2024
1 parent 6500b34 commit 426ecdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions includes/js/ajax.playlist.shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions public/js/player56s.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
});
});
Expand Down

0 comments on commit 426ecdc

Please sign in to comment.