From 14fb4b40230c0eb652174d69a85e37049decb519 Mon Sep 17 00:00:00 2001 From: Krateng Date: Wed, 11 Dec 2019 15:17:49 +0100 Subject: [PATCH] Database fixing from web interface should now work again --- maloja/database.py | 3 ++- maloja/web/admin.pyhp | 1 + maloja/web/issues.html | 4 ++-- maloja/web/wait.html | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/maloja/database.py b/maloja/database.py index 00258f4..c292013 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -862,7 +862,8 @@ def rebuild(**keys): global db_rulestate db_rulestate = False sync() - os.system("python3 fixexisting.py") + from .fixexisting import fix + fix() global cla, coa cla = CleanerAgent() coa = CollectorAgent() diff --git a/maloja/web/admin.pyhp b/maloja/web/admin.pyhp index 0221c61..15a359f 100644 --- a/maloja/web/admin.pyhp +++ b/maloja/web/admin.pyhp @@ -97,6 +97,7 @@ Server Setup
Manual Scrobbling + Database Maintenance diff --git a/maloja/web/issues.html b/maloja/web/issues.html index 59eb1bd..1a8bb9e 100644 --- a/maloja/web/issues.html +++ b/maloja/web/issues.html @@ -43,7 +43,7 @@ var xhttp = new XMLHttpRequest(); - xhttp.open("POST","/db/newrule?", true); + xhttp.open("POST","/api/newrule?", true); xhttp.send(keys); e = arguments[0] line = e.parentNode @@ -56,7 +56,7 @@ apikey = document.getElementById("apikey").value var xhttp = new XMLHttpRequest(); - xhttp.open("POST","/db/rebuild", true); + xhttp.open("POST","/api/rebuild", true); xhttp.send("key=" + encodeURIComponent(apikey)) window.location = "/wait"; } diff --git a/maloja/web/wait.html b/maloja/web/wait.html index d6b847a..3367376 100644 --- a/maloja/web/wait.html +++ b/maloja/web/wait.html @@ -31,7 +31,7 @@ console.log("Probing..."); pending = true; var xhttp = new XMLHttpRequest(); - xhttp.open("GET","/db/test", true); + xhttp.open("GET","/api/test", true); xhttp.onreadystatechange = goback; xhttp.send();