Commit 79a8fa59 authored by Ciaran Ainsworth's avatar Ciaran Ainsworth Committed by Georg Krause
Browse files

Fixed vue widget and artist serializer

parent 0c8f4400
......@@ -161,20 +161,20 @@ def serialize_artist_simple(artist):
"is_local": artist.is_local,
"content_category": artist.content_category,
}
if "description" in artist._state.fields_cache:
data["description"] = (
common_serializers.ContentSerializer(artist.description).data
if artist.description
else None
)
if "attachment_cover" in artist._state.fields_cache:
data["cover"] = (
cover_field.to_representation(artist.attachment_cover)
if artist.attachment_cover
else None
)
if "channel" in artist._state.fields_cache and artist.get_channel():
data["description"] = (
common_serializers.ContentSerializer(artist.description).data
if artist.description
else None
)
data["cover"] = (
cover_field.to_representation(artist.attachment_cover)
if artist.attachment_cover
else None
)
if artist.get_channel():
data["channel"] = str(artist.channel.uuid)
if getattr(artist, "_tracks_count", None) is not None:
......
......@@ -8,6 +8,8 @@
<div :class="['item', itemClasses]" v-for="object in objects" :key="object.id">
<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-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">
<play-button class="play-overlay" :icon-only="true" :button-classes="['ui', 'circular', 'tiny', 'vibrant', 'icon', 'button']" :track="object.track"></play-button>
</div>
......
Supports Markdown
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