@router.get(config.get("base_url") + "/api/info.json", response_class=JSONResponse)
def api_info():
fba.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'misskey', 'friendica', 'bookwyrm', 'takahe', 'peertube')), (SELECT COUNT(blocker) FROM blocks), (SELECT COUNT(domain) FROM instances WHERE last_status_code IS NOT NULL)")
- known, indexed, blocklist, errorous = fba.cursor.fetchone()
+ row = fba.cursor.fetchone()
return {
- "known_instances" : known,
- "indexed_instances" : indexed,
- "blocks_recorded" : blocklist,
- "errorous_instances": errorous,
+ "known_instances" : row[0],
+ "indexed_instances" : row[1],
+ "blocks_recorded" : row[2],
+ "errorous_instances": row[3],
"slogan" : config.get("slogan")
}