[web-src] Show cover artwork in album listings

This commit is contained in:
chme
2020-07-26 07:47:37 +02:00
parent 9c4c25f507
commit 48e766e1ae
8 changed files with 81 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ import stringToColor from 'string-to-color'
export default {
name: 'CoverArtwork',
props: ['artist', 'album', 'artwork_url'],
props: ['artist', 'album', 'artwork_url', 'maxwidth', 'maxheight'],
data () {
return {
@@ -30,6 +30,9 @@ export default {
computed: {
artwork_url_with_size: function () {
if (this.maxwidth > 0 && this.maxheight > 0) {
return webapi.artwork_url_append_size_params(this.artwork_url, this.maxwidth, this.maxheight)
}
return webapi.artwork_url_append_size_params(this.artwork_url)
},

View File

@@ -1,6 +1,10 @@
<template functional>
<div class="media" :id="'index_' + props.album.name_sort.charAt(0).toUpperCase()">
<slot name="artwork"></slot>
<div class="media-left fd-has-action"
v-if="$slots['artwork']"
@click="listeners.click">
<slot name="artwork"></slot>
</div>
<div class="media-content fd-has-action is-clipped" @click="listeners.click">
<div style="margin-top:0.7rem;">
<h1 class="title is-6">{{ props.album.name }}</h1>