From: Roland Häder Date: Sat, 24 Jun 2023 10:41:19 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=859d5886637082fd23e2def506aa28100c39a1b4;p=fba.git Continued: - include all block levels --- diff --git a/api.py b/api.py index 3710197..f473936 100644 --- a/api.py +++ b/api.py @@ -60,9 +60,9 @@ def api_scoreboard(mode: str, amount: int): raise HTTPException(status_code=400, detail="Too many results") if mode == "blocked": - database.cursor.execute("SELECT blocked, COUNT(blocked) AS score FROM blocks WHERE block_level = 'reject' GROUP BY blocked ORDER BY score DESC LIMIT ?", [amount]) + database.cursor.execute("SELECT blocked, COUNT(blocked) AS score FROM blocks GROUP BY blocked ORDER BY score DESC LIMIT ?", [amount]) elif mode == "blocker": - database.cursor.execute("SELECT blocker, COUNT(blocker) AS score FROM blocks WHERE block_level = 'reject' GROUP BY blocker ORDER BY score DESC LIMIT ?", [amount]) + database.cursor.execute("SELECT blocker, COUNT(blocker) AS score FROM blocks GROUP BY blocker ORDER BY score DESC LIMIT ?", [amount]) elif mode == "reference": database.cursor.execute("SELECT origin, COUNT(domain) AS score FROM instances WHERE software IS NOT NULL GROUP BY origin ORDER BY score DESC LIMIT ?", [amount]) elif mode == "software":