mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 19:59:17 +02:00
See #170: cover on tracks and artists
This commit is contained in:
parent
db1cb30df8
commit
71b400a9b8
34 changed files with 582 additions and 254 deletions
|
@ -64,7 +64,7 @@ class ManageArtistViewSet(
|
|||
queryset = (
|
||||
music_models.Artist.objects.all()
|
||||
.order_by("-id")
|
||||
.select_related("attributed_to")
|
||||
.select_related("attributed_to", "attachment_cover",)
|
||||
.prefetch_related(
|
||||
"tracks",
|
||||
Prefetch(
|
||||
|
@ -164,7 +164,11 @@ class ManageTrackViewSet(
|
|||
music_models.Track.objects.all()
|
||||
.order_by("-id")
|
||||
.select_related(
|
||||
"attributed_to", "artist", "album__artist", "album__attachment_cover"
|
||||
"attributed_to",
|
||||
"artist",
|
||||
"album__artist",
|
||||
"album__attachment_cover",
|
||||
"attachment_cover",
|
||||
)
|
||||
.annotate(uploads_count=Coalesce(Subquery(uploads_subquery), 0))
|
||||
.prefetch_related(music_views.TAG_PREFETCH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue