diff --git a/api/funkwhale_api/audio/serializers.py b/api/funkwhale_api/audio/serializers.py index 2f6b76442..2e412c3e9 100644 --- a/api/funkwhale_api/audio/serializers.py +++ b/api/funkwhale_api/audio/serializers.py @@ -239,6 +239,7 @@ class ChannelSerializer(serializers.ModelSerializer): actor = serializers.SerializerMethodField() attributed_to = federation_serializers.APIActorSerializer() rss_url = serializers.CharField(source="get_rss_url") + url = serializers.SerializerMethodField() class Meta: model = models.Channel @@ -250,6 +251,7 @@ class ChannelSerializer(serializers.ModelSerializer): "creation_date", "metadata", "rss_url", + "url", ] def get_artist(self, obj): @@ -269,6 +271,9 @@ class ChannelSerializer(serializers.ModelSerializer): return None return federation_serializers.APIActorSerializer(obj.actor).data + def get_url(self, obj): + return obj.actor.url + class SubscriptionSerializer(serializers.Serializer): approved = serializers.BooleanField(read_only=True) diff --git a/api/tests/audio/test_serializers.py b/api/tests/audio/test_serializers.py index add106888..1b647389a 100644 --- a/api/tests/audio/test_serializers.py +++ b/api/tests/audio/test_serializers.py @@ -227,6 +227,7 @@ def test_channel_serializer_representation(factories, to_api_date): ).data, "metadata": {}, "rss_url": channel.get_rss_url(), + "url": channel.actor.url, } expected["artist"]["description"] = common_serializers.ContentSerializer( content @@ -249,6 +250,7 @@ def test_channel_serializer_external_representation(factories, to_api_date): ).data, "metadata": {}, "rss_url": channel.get_rss_url(), + "url": channel.actor.url, } expected["artist"]["description"] = common_serializers.ContentSerializer( content diff --git a/front/src/views/channels/DetailBase.vue b/front/src/views/channels/DetailBase.vue index ca086d5f9..9250cc588 100644 --- a/front/src/views/channels/DetailBase.vue +++ b/front/src/views/channels/DetailBase.vue @@ -128,6 +128,12 @@