From 9b75020c9110636bab9f0aa306a1cc900c5024d6 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 12 Nov 2022 09:26:28 +0100 Subject: [PATCH] Fix for profile image URL support --- app/actor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/actor.py b/app/actor.py index 31fbd85..ecf53f1 100644 --- a/app/actor.py +++ b/app/actor.py @@ -82,15 +82,21 @@ class Actor: @property def icon_url(self) -> str | None: - return self.ap_actor.get("icon", {}).get("url") + if icon := self.ap_actor.get("icon"): + return icon.get("url") + return None @property def icon_media_type(self) -> str | None: - return self.ap_actor.get("icon", {}).get("mediaType") + if icon := self.ap_actor.get("icon"): + return icon.get("mediaType") + return None @property def image_url(self) -> str | None: - return self.ap_actor.get("image", {}).get("url") + if image := self.ap_actor.get("image"): + return image.get("url") + return None @property def public_key_as_pem(self) -> str: