database.cursor.execute("SELECT software, AVG(total_peers) AS average FROM instances WHERE software IS NOT NULL GROUP BY software HAVING average>0 ORDER BY average DESC LIMIT ?", [amount])
elif mode == "obsfucator":
database.cursor.execute("SELECT software, COUNT(domain) AS cnt FROM instances WHERE has_obsfucation = 1 GROUP BY software ORDER BY cnt DESC LIMIT ?", [amount])
+ elif mode == "obsfucation":
+ database.cursor.execute("SELECT has_obsfucation, COUNT(domain) AS cnt FROM instances WHERE software IN ('pleroma', 'mastodon') GROUP BY has_obsfucation ORDER BY cnt DESC LIMIT ?", [amount])
else:
raise HTTPException(status_code=400, detail="No filter specified")
response = requests.get(f"http://{config.get('host')}:{config.get('port')}{config.get('base_url')}/api/scoreboard.json?mode=avg_peers&amount={amount}")
elif mode == "obsfucator" and amount > 0:
response = requests.get(f"http://{config.get('host')}:{config.get('port')}{config.get('base_url')}/api/scoreboard.json?mode=obsfucator&amount={amount}")
+ elif mode == "obsfucation" and amount > 0:
+ response = requests.get(f"http://{config.get('host')}:{config.get('port')}{config.get('base_url')}/api/scoreboard.json?mode=obsfucation&amount={amount}")
else:
raise HTTPException(status_code=400, detail="No filter specified")