1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-28 11:50:26 +00:00

Fix ajax callback

This commit is contained in:
jcorporation 2018-06-20 00:23:08 +01:00
parent 8555803683
commit 39e963804e

View File

@ -928,11 +928,7 @@ function updatePlayIcon(obj) {
} }
function sendAPI(request, callback) { function sendAPI(request, callback) {
$.ajax({url: "/api", contentType:"application/json", method: "POST", data: JSON.stringify(request)}).done(function(obj,callback) { $.ajax({url: "/api", contentType:"application/json", method: "POST", data: JSON.stringify(request), success: callback });
if (callback != undefined && typeof callback == 'function') {
callback(obj);
}
});
} }
function updateDB(event) { function updateDB(event) {
@ -1269,10 +1265,9 @@ function notificationsSupported() {
return "Notification" in window; return "Notification" in window;
} }
function songChange(title, artist, album, uri, songId) { function songChange(obj) {
if (last_song == obj.data.title+obj.data.artist+obj.data.album+obj.data.uri+obj.data.currentsongid) if (last_song == obj.data.title+obj.data.artist+obj.data.album+obj.data.uri+obj.data.currentsongid)
return; return;
var textNotification = ''; var textNotification = '';
var htmlNotification = ''; var htmlNotification = '';
var pageTitle = 'myMPD: '; var pageTitle = 'myMPD: ';