diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7a7e106e8..e10b8b981 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,6 +136,7 @@ test_api: - branches before_script: - apk add make git gcc python3-dev musl-dev + - apk add postgresql-dev py3-psycopg2 libldap libffi-dev make zlib-dev jpeg-dev openldap-dev - cd api - pip3 install -r requirements/base.txt - pip3 install -r requirements/local.txt diff --git a/api/funkwhale_api/music/serializers.py b/api/funkwhale_api/music/serializers.py index 6abd6e262..3f68fd9fc 100644 --- a/api/funkwhale_api/music/serializers.py +++ b/api/funkwhale_api/music/serializers.py @@ -177,6 +177,8 @@ def serialize_artist_simple(artist): if artist.attachment_cover else None ) + if "channel" in artist._state.fields_cache and artist.get_channel(): + data["channel"] = str(artist.channel.uuid) if getattr(artist, "_tracks_count", None) is not None: data["tracks_count"] = artist._tracks_count @@ -857,4 +859,5 @@ class AlbumCreateSerializer(serializers.Serializer): instance, "description", validated_data.get("description") ) tag_models.set_tags(instance, *(validated_data.get("tags", []) or [])) + instance.artist.get_channel() return instance diff --git a/api/funkwhale_api/music/views.py b/api/funkwhale_api/music/views.py index e38b15887..6006ce9c3 100644 --- a/api/funkwhale_api/music/views.py +++ b/api/funkwhale_api/music/views.py @@ -180,7 +180,7 @@ class AlbumViewSet( queryset = ( models.Album.objects.all() .order_by("-creation_date") - .prefetch_related("artist", "attributed_to", "attachment_cover") + .prefetch_related("artist__channel", "attributed_to", "attachment_cover") ) serializer_class = serializers.AlbumSerializer permission_classes = [oauth_permissions.ScopePermission] diff --git a/changes/changelog.d/1175.bugfix b/changes/changelog.d/1175.bugfix new file mode 100644 index 000000000..29283b2d3 --- /dev/null +++ b/changes/changelog.d/1175.bugfix @@ -0,0 +1 @@ +Fix embedded player not working on channel serie/album (#1175) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index ae278c5e2..9cbeb8198 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,9 +30,9 @@ FUNKWHALE_CONFIG = { "FUNKWHALE_URL": "mypod.funkwhale", "FUNKWHAL_PROTOCOL": "https", "DATABASE_URL": "postgres://localhost:5432/db", - "AWS_ACCESS_KEY_ID": 'my_access_key', - "AWS_SECRET_ACCESS_KEY": 'my_secret_key', - "AWS_STORAGE_BUCKET_NAME": 'my_bucket', + "AWS_ACCESS_KEY_ID": "my_access_key", + "AWS_SECRET_ACCESS_KEY": "my_secret_key", + "AWS_STORAGE_BUCKET_NAME": "my_bucket", } for key, value in FUNKWHALE_CONFIG.items(): os.environ[key] = value diff --git a/front/src/EmbedFrame.vue b/front/src/EmbedFrame.vue index dd830b486..517f2869d 100644 --- a/front/src/EmbedFrame.vue +++ b/front/src/EmbedFrame.vue @@ -280,6 +280,7 @@ export default { }, fetchTracks (filters, path) { path = path || "/api/v1/tracks/" + filters.include_channels = "true" let self = this let url = `${this.baseUrl}${path}` axios.get(url, {params: filters}).then(response => { diff --git a/front/src/components/library/AlbumDropdown.vue b/front/src/components/library/AlbumDropdown.vue index 8a065833e..3bb4a3b98 100644 --- a/front/src/components/library/AlbumDropdown.vue +++ b/front/src/components/library/AlbumDropdown.vue @@ -5,7 +5,7 @@
Embed this album on your website
-
+
diff --git a/front/src/components/library/ArtistBase.vue b/front/src/components/library/ArtistBase.vue index d7ff13a66..6cb631a75 100644 --- a/front/src/components/library/ArtistBase.vue +++ b/front/src/components/library/ArtistBase.vue @@ -38,7 +38,7 @@
Embed this artist work on your website
-
+
diff --git a/front/src/components/library/TrackBase.vue b/front/src/components/library/TrackBase.vue index 8af866daf..5263789dd 100644 --- a/front/src/components/library/TrackBase.vue +++ b/front/src/components/library/TrackBase.vue @@ -30,7 +30,7 @@
Embed this track on your website
-
+
diff --git a/front/src/views/channels/DetailBase.vue b/front/src/views/channels/DetailBase.vue index 06491313f..cedc36ab4 100644 --- a/front/src/views/channels/DetailBase.vue +++ b/front/src/views/channels/DetailBase.vue @@ -159,7 +159,7 @@
Embed this artist work on your website
-
+
diff --git a/front/src/views/playlists/Detail.vue b/front/src/views/playlists/Detail.vue index 99bf84761..6612d4af6 100644 --- a/front/src/views/playlists/Detail.vue +++ b/front/src/views/playlists/Detail.vue @@ -52,7 +52,7 @@
Embed this playlist on your website
-
+