Commit c60bc939 authored by Ciarán Ainsworth's avatar Ciarán Ainsworth Committed by Georg Krause
Browse files

Fix recently listened widget and simple artist serializer


(cherry picked from commit 071ff89a)
parent f38fca69
...@@ -56,7 +56,9 @@ class ListeningViewSet( ...@@ -56,7 +56,9 @@ class ListeningViewSet(
) )
tracks = Track.objects.with_playable_uploads( tracks = Track.objects.with_playable_uploads(
music_utils.get_actor_from_request(self.request) music_utils.get_actor_from_request(self.request)
).select_related("artist", "album__artist", "attributed_to") ).select_related(
"artist", "album__artist", "attributed_to", "artist__attachment_cover"
)
return queryset.prefetch_related(Prefetch("track", queryset=tracks)) return queryset.prefetch_related(Prefetch("track", queryset=tracks))
def get_serializer_context(self): def get_serializer_context(self):
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<div :class="['item', itemClasses]" v-for="object in objects" :key="object.id"> <div :class="['item', itemClasses]" v-for="object in objects" :key="object.id">
<div class="ui tiny image"> <div class="ui tiny image">
<img alt="" v-if="object.track.album && object.track.album.cover" v-lazy="$store.getters['instance/absoluteUrl'](object.track.album.cover.urls.medium_square_crop)"> <img alt="" v-if="object.track.album && object.track.album.cover" v-lazy="$store.getters['instance/absoluteUrl'](object.track.album.cover.urls.medium_square_crop)">
<img alt="" v-else-if="object.track.cover" v-lazy="$store.getters['instance/absoluteUrl'](object.track.cover.urls.medium_square_crop)"/>
<img alt="" v-else-if="object.track.artist.cover" v-lazy="$store.getters['instance/absoluteUrl'](object.track.artist.cover.urls.medium_square_crop)"/>
<img alt="" v-else src="../../../assets/audio/default-cover.png"> <img alt="" v-else src="../../../assets/audio/default-cover.png">
<play-button class="play-overlay" :icon-only="true" :button-classes="['ui', 'circular', 'tiny', 'vibrant', 'icon', 'button']" :track="object.track"></play-button> <play-button class="play-overlay" :icon-only="true" :button-classes="['ui', 'circular', 'tiny', 'vibrant', 'icon', 'button']" :track="object.track"></play-button>
</div> </div>
......
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