Correct autoflow not trigered when delete

This commit is contained in:
Sebastien 2018-03-05 17:28:31 +01:00
parent ba876df45e
commit e957906da7
2 changed files with 16 additions and 4 deletions

View File

@ -141,12 +141,13 @@ public class TrackScheduler extends AudioEventAdapter {
return false; return false;
} else { } else {
logger.info("Delete succeful"); logger.info("Delete succeful");
needAutoPlay();
return true; return true;
} }
} }
} }
logger.info("Delete failure! Not found."); logger.info("Delete failure! Not found.");
needAutoPlay();
return false; return false;
} }

View File

@ -10,7 +10,7 @@ var btn_info;
var btn_disconnect; var btn_disconnect;
var btn_flush; var btn_flush;
var btn_add; var btn_add;
var loadingFlag = false;
$(document).ready(function() { $(document).ready(function() {
@ -161,6 +161,7 @@ function getCurentMusic() {
break; break;
} }
getPlayList(); getPlayList();
}) })
.fail(function (data) { .fail(function (data) {
if(!error){ if(!error){
@ -212,12 +213,21 @@ function getPlayList() {
$('#playlist_list').empty(); $('#playlist_list').empty();
savedPlaylist = {}; savedPlaylist = {};
} }
if(loadingFlag){
modal_loading.modal('close');
loadingFlag = false;
}
}).fail(function (data) { }).fail(function (data) {
if(!error){ if(!error){
alert("Comunication error, please refresh."); alert("Comunication error, please refresh.");
error = true; error = true;
} }
if(loadingFlag){
modal_loading.modal('close');
loadingFlag = false;
}
}); });
@ -252,7 +262,7 @@ function getChannels(){
function updateModal(data){ function updateModal(data){
$('#modal_title').text("Title: "+ data.info.audioTrackInfo.title); $('#modal_title').text("Title: "+ data.info.audioTrackInfo.title);
$('#modal_author').text("Author: "+ data.info.author); $('#modal_author').text("Author: "+ data.info.audioTrackInfo.author);
$('#modal_lenght').text("Duration: "+ msToTime(data.info.audioTrackInfo.length)); $('#modal_lenght').text("Duration: "+ msToTime(data.info.audioTrackInfo.length));
$('#modal_url').text("URL: "+ data.info.audioTrackInfo.uri); $('#modal_url').text("URL: "+ data.info.audioTrackInfo.uri);
$('#modal_submit').text("Submitted by: "+ data.info.user); $('#modal_submit').text("Submitted by: "+ data.info.user);
@ -310,8 +320,9 @@ function sendCommand(command){
data: JSON.stringify(command), data: JSON.stringify(command),
success: function (data) { success: function (data) {
console.log(data); console.log(data);
loadingFlag = true;
getCurentMusic(); getCurentMusic();
modal_loading.modal('close');
} }
}).fail(function (data) { }).fail(function (data) {