diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index f221c89..e769770 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -693,6 +693,6 @@ def reparse_scrobble(timestamp): } else: return { - "status":"no-operation", + "status":"no_operation", "desc":"The scrobble was not changed." } diff --git a/maloja/web/static/js/edit.js b/maloja/web/static/js/edit.js index d0119b3..ecb08d3 100644 --- a/maloja/web/static/js/edit.js +++ b/maloja/web/static/js/edit.js @@ -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); }