diff --git a/api/config/settings/common.py b/api/config/settings/common.py index 06194348d..b1283ea86 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -1223,6 +1223,7 @@ VERSATILEIMAGEFIELD_RENDITION_KEY_SETS = { "attachment_square": [ ("original", "url"), ("medium_square_crop", "crop__200x200"), + ("large_square_crop", "crop__600x600"), ], } VERSATILEIMAGEFIELD_SETTINGS = { diff --git a/api/funkwhale_api/common/models.py b/api/funkwhale_api/common/models.py index e0bd21619..688af5406 100644 --- a/api/funkwhale_api/common/models.py +++ b/api/funkwhale_api/common/models.py @@ -267,6 +267,13 @@ class Attachment(models.Model): proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": self.uuid}) return federation_utils.full_url(proxy_url + "?next=medium_square_crop") + @property + def download_url_large_square_crop(self): + if self.file: + return utils.media_url(self.file.crop["600x600"].url) + proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": self.uuid}) + return federation_utils.full_url(proxy_url + "?next=large_square_crop") + class MutationAttachment(models.Model): """ diff --git a/api/funkwhale_api/common/serializers.py b/api/funkwhale_api/common/serializers.py index 9210c0603..fa194ea8a 100644 --- a/api/funkwhale_api/common/serializers.py +++ b/api/funkwhale_api/common/serializers.py @@ -297,6 +297,7 @@ class AttachmentSerializer(serializers.Serializer): urls["source"] = o.url urls["original"] = o.download_url_original urls["medium_square_crop"] = o.download_url_medium_square_crop + urls["large_square_crop"] = o.download_url_large_square_crop return urls def create(self, validated_data): diff --git a/api/funkwhale_api/common/views.py b/api/funkwhale_api/common/views.py index a4818acd9..fe669ad21 100644 --- a/api/funkwhale_api/common/views.py +++ b/api/funkwhale_api/common/views.py @@ -175,7 +175,7 @@ class AttachmentViewSet( return r size = request.GET.get("next", "original").lower() - if size not in ["original", "medium_square_crop"]: + if size not in ["original", "medium_square_crop", "large_square_crop"]: size = "original" try: diff --git a/api/funkwhale_api/federation/tasks.py b/api/funkwhale_api/federation/tasks.py index 86bef50e1..c2bdfad34 100644 --- a/api/funkwhale_api/federation/tasks.py +++ b/api/funkwhale_api/federation/tasks.py @@ -429,7 +429,7 @@ def fetch(fetch_obj): ) except Exception: logger.exception( - "Error while fetching actor outbox: %s", obj.actor.outbox.url + "Error while fetching actor outbox: %s", obj.actor.outbox_url ) else: if result.get("next_page"): diff --git a/api/tests/common/test_serializers.py b/api/tests/common/test_serializers.py index 1d23efb66..e8ef04bca 100644 --- a/api/tests/common/test_serializers.py +++ b/api/tests/common/test_serializers.py @@ -200,6 +200,9 @@ def test_attachment_serializer_existing_file(factories, to_api_date): "medium_square_crop": federation_utils.full_url( attachment.file.crop["200x200"].url ), + "large_square_crop": federation_utils.full_url( + attachment.file.crop["600x600"].url + ), }, } @@ -227,6 +230,9 @@ def test_attachment_serializer_remote_file(factories, to_api_date): "medium_square_crop": federation_utils.full_url( proxy_url + "?next=medium_square_crop" ), + "large_square_crop": federation_utils.full_url( + proxy_url + "?next=large_square_crop" + ), }, } diff --git a/changes/changelog.d/1205.enhancement b/changes/changelog.d/1205.enhancement new file mode 100644 index 000000000..a3ccf4dc3 --- /dev/null +++ b/changes/changelog.d/1205.enhancement @@ -0,0 +1 @@ +Added a new, large thumbnail size for cover images (#1205 \ No newline at end of file diff --git a/changes/changelog.d/1210.enhancement b/changes/changelog.d/1210.enhancement new file mode 100644 index 000000000..a41d714e5 --- /dev/null +++ b/changes/changelog.d/1210.enhancement @@ -0,0 +1 @@ +Enforce authentication when viewing remote channels, profiles and libraries (#1210) \ No newline at end of file diff --git a/front/src/components/Queue.vue b/front/src/components/Queue.vue index bc6979164..59971c21e 100644 --- a/front/src/components/Queue.vue +++ b/front/src/components/Queue.vue @@ -6,8 +6,8 @@