diff --git a/tasks.py b/tasks.py index d7f5f05..1670fcf 100644 --- a/tasks.py +++ b/tasks.py @@ -234,7 +234,8 @@ def cache_attachments(self, iri: str) -> None: if activity.has_type(ap.ActivityType.CREATE): for attachment in activity.get_object()._data.get("attachment", []): - MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT) + if attachment.get("mediaType", "").startswith("image/"): + MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT) log.info(f"attachments cached for {iri}") diff --git a/templates/utils.html b/templates/utils.html index ebf5f23..88720f2 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -54,7 +54,7 @@