]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 4 Sep 2023 23:15:53 +0000 (01:15 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 4 Sep 2023 23:15:53 +0000 (01:15 +0200)
- no need for double-fetching generic JSON API

fba/networks/mastodon.py

index f0de5de88b33a0217ec5b257f651eb7d1952006f..88fd35fdd8648ab0fd5f4a96cd10ded3de40d89d 100644 (file)
@@ -66,7 +66,7 @@ def fetch_blocks_from_about(domain: str) -> dict:
     if not instances.is_registered(domain):
         raise Exception(f"domain='{domain}' is not registered but function is invoked.")
 
-    logger.debug("Fetching mastodon blocks from domain='%s'", domain)
+    logger.info("Fetching mastodon blocks from domain='%s'", domain)
     doc = None
     for path in ["/about/more", "/about"]:
         try:
@@ -153,13 +153,8 @@ def fetch_blocks(domain: str) -> list:
 
     blocklist = list()
 
-    logger.debug("Invoking federation.fetch_blocks(%s) ...", domain)
-    rows = federation.fetch_blocks(domain)
-
-    logger.debug("rows[%s]()=%d", type(rows), len(rows))
-    if len(rows) == 0:
-        logger.debug("domain='%s' has returned zero rows, trying /about/more page ...", domain)
-        rows = fetch_blocks_from_about(domain)
+    logger.debug("Invoking fetch_blocks_from_about(%s) ...", domain)
+    rows = fetch_blocks_from_about(domain)
 
     logger.debug("rows[%s]()=%d", type(rows), len(rows))
     if len(rows) > 0: