1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Reload on reparse

This commit is contained in:
krateng 2022-04-22 21:37:48 +02:00
parent cf4b3cd68f
commit 529d0c8a5d
2 changed files with 16 additions and 2 deletions

View File

@ -693,6 +693,6 @@ def reparse_scrobble(timestamp):
}
else:
return {
"status":"no-operation",
"status":"no_operation",
"desc":"The scrobble was not changed."
}

View File

@ -40,7 +40,21 @@ function toggleReparseConfirm(element) {
function reparseScrobble(id, element) {
toggleReparseConfirm(element);
neo.xhttpreq("/apis/mlj_1/reparse_scrobble",data={'timestamp':id},method="POST",callback=notifyCallback,json=true);
callback_func = function(req){
if (req.status == 200) {
if (req.response.status != 'no_operation') {
window.location.reload();
}
else {
notifyCallback(req);
}
}
else {
notifyCallback(req);
}
};
neo.xhttpreq("/apis/mlj_1/reparse_scrobble",data={'timestamp':id},method="POST",callback=callback_func,json=true);
}