Correct clear playlist bug

This commit is contained in:
Sebastien 2018-11-28 12:38:27 +02:00
parent 8f1fa59b75
commit e44bbdbab7

View File

@ -105,6 +105,10 @@ function getCurentMusic() {
$('#current_time').text("00:00"); $('#current_time').text("00:00");
btn_play.removeClass("amber"); btn_play.removeClass("amber");
btn_play.addClass("green"); btn_play.addClass("green");
if(savedPlaylist != null){
$('#playlist_list').empty();
savedPlaylist = null;
}
break; break;
@ -163,6 +167,10 @@ function getCurentMusic() {
} }
clearInterval(interval); clearInterval(interval);
if(savedPlaylist != null){
$('#playlist_list').empty();
savedPlaylist = null;
}
break; break;
} }
if (switchAutoFlow.is(':checked') != data.autoflow) if (switchAutoFlow.is(':checked') != data.autoflow)
@ -533,14 +541,14 @@ function listeners() {
$('#btn_play').click(function () { $('#btn_play').click(function () {
switch (state) { switch (state) {
case "PLAYING": case "PLAYING":
sendCommand({command: "PAUSE"}, true); sendCommand({command: "PAUSE"}, false);
break; break;
case "PAUSE": case "PAUSE":
sendCommand({command: "PLAY"}, true); sendCommand({command: "PLAY"}, false);
break; break;
default: default:
sendCommand({command: "PLAY"},true); sendCommand({command: "PLAY"}, false);
} }
}); });
@ -553,10 +561,10 @@ function listeners() {
}); });
$('#btn_next').click(function () { $('#btn_next').click(function () {
sendCommand({command: "NEXT"},true); sendCommand({command: "NEXT"}, false);
}); })
$('#btn_stop').click(function () { $('#btn_stop').click(function () {
sendCommand({command: "STOP"}, true); sendCommand({command: "STOP"}, false);
}); });
@ -582,7 +590,7 @@ function listeners() {
var command = { var command = {
command: "FLUSH" command: "FLUSH"
}; };
sendCommand(command, true); sendCommand(command, false);
}); });
$('#btn_ok_channel').click(function () { $('#btn_ok_channel').click(function () {