[web] Simplify method artwork_url

This commit is contained in:
Alain Nussbaumer 2024-02-28 14:35:03 +01:00
parent 1936ce6621
commit 8aa2b3d5ac
5 changed files with 9 additions and 24 deletions

View File

@ -7,7 +7,7 @@
<div class="card"> <div class="card">
<div class="card-content"> <div class="card-content">
<cover-artwork <cover-artwork
:artwork_url="artwork_url" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-shadow fd-cover fd-cover-normal-image mb-5" class="fd-has-shadow fd-cover fd-cover-normal-image mb-5"
@ -104,11 +104,8 @@ export default {
}, },
computed: { computed: {
artwork_url() { artwork_url(album) {
if (this.album.images && this.album.images.length > 0) { return album.images?.[0]?.url || ''
return this.album.images[0].url
}
return ''
} }
}, },

View File

@ -25,7 +25,7 @@
</template> </template>
<template #heading-right> <template #heading-right>
<cover-artwork <cover-artwork
:artwork_url="artwork_url" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image" class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
@ -129,11 +129,8 @@ export default {
}, },
computed: { computed: {
artwork_url() { artwork_url(album) {
if (this.album.images && this.album.images.length > 0) { return album.images?.[0]?.url || ''
return this.album.images[0].url
}
return ''
} }
}, },

View File

@ -211,10 +211,7 @@ export default {
}, },
artwork_url(album) { artwork_url(album) {
if (album.images && album.images.length > 0) { return album.images?.[0]?.url || ''
return album.images[0].url
}
return ''
} }
} }
} }

View File

@ -128,10 +128,7 @@ export default {
}, },
artwork_url(album) { artwork_url(album) {
if (album.images && album.images.length > 0) { return album.images?.[0]?.url || ''
return album.images[0].url
}
return ''
} }
} }
} }

View File

@ -405,10 +405,7 @@ export default {
methods: { methods: {
artwork_url(album) { artwork_url(album) {
if (album.images && album.images.length > 0) { return album.images?.[0]?.url || ''
return album.images[0].url
}
return ''
}, },
new_search() { new_search() {
if (!this.search_query) { if (!this.search_query) {