]> git.mxchange.org Git - fba.git/commitdiff
Continue:
authorRoland Häder <roland@mxchange.org>
Sun, 18 Jun 2023 01:35:46 +0000 (03:35 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 18 Jun 2023 01:35:46 +0000 (03:35 +0200)
- continue checking on software type after it was discovered by
  generator/site_name
- maybe it needs aliasing?
- also add 'slipfox calckey' as an alias for 'misskey'
- don't tidy-up None values

fba/federation.py

index 55a0b21ae30cb4aab5d10aa6db33dfbe6f8e9f22..9ccbc60337fc46ab9e3dbea2b1493118f2f3b6f8 100644 (file)
@@ -437,20 +437,25 @@ def determine_software(domain: str, path: str = None) -> str:
     elif "software" not in data or "name" not in data["software"]:
         # DEBUG: print(f"DEBUG: JSON response from domain='{domain}' does not include [software][name], fetching / ...")
         software = fetch_generator_from_path(domain)
+        # DEBUG: print(f"DEBUG: Generator for domain='{domain}' is: '{software}'")
+    elif "software" in data and "name" in data["software"]:
+        # DEBUG: print("DEBUG: Found data[software][name] in JSON response")
+        software = data["software"]["name"]
 
-        # DEBUG: print(f"DEBUG: Generator for domain='{domain}' is: {software}, EXIT!")
-        return software
-
-    software = tidyup.domain(data["software"]["name"])
+    if software is None:
+        # DEBUG: print("DEBUG: Returning None - EXIT!")
+        return None
 
+    sofware = tidyup.domain(software)
     # DEBUG: print("DEBUG: sofware after tidyup.domain():", software)
+
     if software in ["akkoma", "rebased"]:
         # DEBUG: print("DEBUG: Setting pleroma:", domain, software)
         software = "pleroma"
     elif software in ["hometown", "ecko"]:
         # DEBUG: print("DEBUG: Setting mastodon:", domain, software)
         software = "mastodon"
-    elif software in ["calckey", "groundpolis", "foundkey", "cherrypick", "meisskey"]:
+    elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey"]:
         # DEBUG: print("DEBUG: Setting misskey:", domain, software)
         software = "misskey"
     elif software == "runtube.re":