forked from forks/microblog.pub
Fix for profile image URL support
This commit is contained in:
parent
36a1a6bd9c
commit
9b75020c91
1 changed files with 9 additions and 3 deletions
12
app/actor.py
12
app/actor.py
|
@ -82,15 +82,21 @@ class Actor:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon_url(self) -> str | None:
|
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
|
@property
|
||||||
def icon_media_type(self) -> str | None:
|
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
|
@property
|
||||||
def image_url(self) -> str | None:
|
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
|
@property
|
||||||
def public_key_as_pem(self) -> str:
|
def public_key_as_pem(self) -> str:
|
||||||
|
|
Loading…
Reference in a new issue