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

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

parent e981f005
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment