]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 1 May 2025 18:23:58 +0000 (20:23 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 1 May 2025 18:23:58 +0000 (20:23 +0200)
- fixed SQL errors (ops, didn't rename these)

daemon.py

index 98fce7e01891db2fe169cdb48cc36fab0b971f0b..994f33d7b4b9fb27fdeccdf73140ae7e3c947a3a 100755 (executable)
--- a/daemon.py
+++ b/daemon.py
@@ -107,9 +107,9 @@ def api_scoreboard(mode: str, amount: int) -> None:
     elif mode == "detection_mode":
         database.cursor.execute("SELECT detection_mode AS data, COUNT(domain) AS score FROM instances GROUP BY detection_mode ORDER BY score DESC LIMIT ?", [amount])
     elif mode == "avg_peers":
-        database.cursor.execute("SELECT software AS data, AVG(total_peers) AS score FROM instances WHERE software IS NOT NULL AND total_peers IS NOT NULL GROUP BY software HAVING average > 0 ORDER BY average DESC LIMIT ?", [amount])
+        database.cursor.execute("SELECT software AS data, AVG(total_peers) AS score FROM instances WHERE software IS NOT NULL AND total_peers IS NOT NULL GROUP BY software HAVING score > 0 ORDER BY score DESC LIMIT ?", [amount])
     elif mode == "avg_blocks":
-        database.cursor.execute("SELECT software AS data, AVG(total_blocks) AS score FROM instances WHERE software IS NOT NULL AND total_blocks IS NOT NULL GROUP BY software HAVING average > 0 ORDER BY average DESC LIMIT ?", [amount])
+        database.cursor.execute("SELECT software AS data, AVG(total_blocks) AS score FROM instances WHERE software IS NOT NULL AND total_blocks IS NOT NULL GROUP BY software HAVING score > 0 ORDER BY score DESC LIMIT ?", [amount])
     elif mode == "obfuscator":
         database.cursor.execute("SELECT software AS data, COUNT(domain) AS score FROM instances WHERE has_obfuscation = 1 GROUP BY software ORDER BY score DESC LIMIT ?", [amount])
     elif mode == "obfuscation":