Skip to content
Snippets Groups Projects
Unverified Commit 4364f9b4 authored by Agate's avatar Agate :speech_balloon:
Browse files

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

parent e981f005
Branches
Tags
No related merge requests found
...@@ -84,8 +84,8 @@ class ManageArtistViewSet( ...@@ -84,8 +84,8 @@ class ManageArtistViewSet(
music_models.Artist.objects.all() music_models.Artist.objects.all()
.order_by("-id") .order_by("-id")
.select_related("attributed_to", "attachment_cover", "channel") .select_related("attributed_to", "attachment_cover", "channel")
.annotate(_tracks_count=Count("tracks")) .annotate(_tracks_count=Count("tracks", distinct=True))
.annotate(_albums_count=Count("albums")) .annotate(_albums_count=Count("albums", distinct=True))
.prefetch_related(music_views.TAG_PREFETCH) .prefetch_related(music_views.TAG_PREFETCH)
) )
serializer_class = serializers.ManageArtistSerializer serializer_class = serializers.ManageArtistSerializer
......
Fixed wrong album and track count in admin artist API (#1096)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment