Commit 3382d8d8 authored by Agate's avatar Agate 💬

Merge branch '1096-wrong-album-count' into 'master'

Fix #1096: Fixed wrong album and track count in admin artist API

See merge request funkwhale/funkwhale!1108
parents e981f005 4364f9b4
......@@ -84,8 +84,8 @@ class ManageArtistViewSet(
music_models.Artist.objects.all()
.order_by("-id")
.select_related("attributed_to", "attachment_cover", "channel")
.annotate(_tracks_count=Count("tracks"))
.annotate(_albums_count=Count("albums"))
.annotate(_tracks_count=Count("tracks", distinct=True))
.annotate(_albums_count=Count("albums", distinct=True))
.prefetch_related(music_views.TAG_PREFETCH)
)
serializer_class = serializers.ManageArtistSerializer
......
Fixed wrong album and track count in admin artist API (#1096)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment