diff --git a/database.py b/database.py index 38c1332..319cd2a 100644 --- a/database.py +++ b/database.py @@ -670,17 +670,20 @@ def issues(): @dbserver.post("/importrules") def import_rulemodule(): keys = FormsDict.decode(request.forms) - filename = keys.get("filename") - remove = keys.get("remove") is not None - validchars = "'-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - filename = "".join(c for c in filename if c in validchars) + apikey = keys.pop("key",None) - if remove: - log("Deactivating predefined rulefile " + filename) - os.remove("rules/" + filename + ".tsv") - else: - log("Importing predefined rulefile " + filename) - os.symlink("predefined/" + filename + ".tsv","rules/" + filename + ".tsv") + if (checkAPIkey(apikey)): + filename = keys.get("filename") + remove = keys.get("remove") is not None + validchars = "-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + filename = "".join(c for c in filename if c in validchars) + + if remove: + log("Deactivating predefined rulefile " + filename) + os.remove("rules/" + filename + ".tsv") + else: + log("Importing predefined rulefile " + filename) + os.symlink("predefined/" + filename + ".tsv","rules/" + filename + ".tsv") diff --git a/website/common/header.html b/website/common/header.html index cee4d3c..2f0c4a3 100644 --- a/website/common/header.html +++ b/website/common/header.html @@ -1,86 +1,3 @@ - - - - + diff --git a/website/issues.html b/website/issues.html index 4b58bc4..a1e8d8b 100644 --- a/website/issues.html +++ b/website/issues.html @@ -4,17 +4,18 @@
Possible Issueswith your library KEY_ISSUES Issues - +Maloja can identify possible problems with consistency or redundancy in your library. After making any changes, you should rebuild your library. |
@@ -22,21 +23,12 @@
+ |
+ ` + name + ` + |
+ `
+ }
+
+ html += `
+ |
+ ` + artists + ` + ` + title + ` + |
+
@@ -99,7 +110,11 @@
After you've scrobbled for a bit, you might want to check the Issues page to see if you need to set up some rules. You can also manually add rules in your server's "rules" directory - just add your own .tsv file and read the instructions on how to declare a rule.
- You can also set up some predefined rulesets right away! + You can also set up some predefined rulesets right away! Enter your API key and click the buttons. + + API Key: + + KEY_PREDEFINED_RULESETS @@ -117,4 +132,6 @@ Done! Visit yourserver.tld (or your public / proxy URL) to look at your overview page. Almost everything is clickable! + + diff --git a/website/setup.py b/website/setup.py index 5b67892..efb75a9 100644 --- a/website/setup.py +++ b/website/setup.py @@ -6,9 +6,21 @@ def instructions(keys): html += " | ||||||
Module | Author | Description | ||||
---|---|---|---|---|---|---|
Remove: | " + html += "Remove: | " else: - html += "Add: | " + html += "Add: | " html += "" + name + " | " html += "" + author + " | " html += "" + desc + " | "