]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 18 Jun 2023 12:10:40 +0000 (14:10 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 18 Jun 2023 12:10:40 +0000 (14:10 +0200)
- sorted network type (aka. "software") members

api.py
fba/commands.py

diff --git a/api.py b/api.py
index da4a2ee65396846933cc0a80a5449e6c8027c52c..1033a01ce80d1e8b1b8e62c981683022f9191a5a 100644 (file)
--- a/api.py
+++ b/api.py
@@ -40,7 +40,7 @@ templates = Jinja2Templates(directory="templates")
 
 @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_error_details IS NOT NULL)")
+    fba.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'bookwyrm', 'takahe', 'peertube')), (SELECT COUNT(blocker) FROM blocks), (SELECT COUNT(domain) FROM instances WHERE last_error_details IS NOT NULL)")
     row = fba.cursor.fetchone()
 
     return {
index dc98d4d6c3d8b063b9383fd300f1fd778f7678ae..4c0211d4829083f0d2546b446d196713e5678c66 100644 (file)
@@ -153,7 +153,7 @@ def fetch_blocks(args: argparse.Namespace):
     else:
         # Re-check after "timeout" (aka. minimum interval)
         fba.cursor.execute(
-            "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'bookwyrm', 'takahe') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_block")]
+            "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'bookwyrm', 'takahe', 'peertube') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_block")]
         )
 
     rows = fba.cursor.fetchall()
@@ -465,7 +465,7 @@ def fetch_instances(args: argparse.Namespace) -> int:
 
     # Loop through some instances
     fba.cursor.execute(
-        "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'bookwyrm', 'takahe', 'lemmy') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_instance")]
+        "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'bookwyrm', 'takahe', 'peertube') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_instance")]
     )
 
     rows = fba.cursor.fetchall()