[web] Simplify method artwork_url
This commit is contained in:
parent
1936ce6621
commit
8aa2b3d5ac
|
@ -7,7 +7,7 @@
|
|||
<div class="card">
|
||||
<div class="card-content">
|
||||
<cover-artwork
|
||||
:artwork_url="artwork_url"
|
||||
:artwork_url="artwork_url(album)"
|
||||
:artist="album.artist"
|
||||
:album="album.name"
|
||||
class="fd-has-shadow fd-cover fd-cover-normal-image mb-5"
|
||||
|
@ -104,11 +104,8 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
artwork_url() {
|
||||
if (this.album.images && this.album.images.length > 0) {
|
||||
return this.album.images[0].url
|
||||
}
|
||||
return ''
|
||||
artwork_url(album) {
|
||||
return album.images?.[0]?.url || ''
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</template>
|
||||
<template #heading-right>
|
||||
<cover-artwork
|
||||
:artwork_url="artwork_url"
|
||||
:artwork_url="artwork_url(album)"
|
||||
:artist="album.artist"
|
||||
:album="album.name"
|
||||
class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
|
||||
|
@ -129,11 +129,8 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
artwork_url() {
|
||||
if (this.album.images && this.album.images.length > 0) {
|
||||
return this.album.images[0].url
|
||||
}
|
||||
return ''
|
||||
artwork_url(album) {
|
||||
return album.images?.[0]?.url || ''
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -211,10 +211,7 @@ export default {
|
|||
},
|
||||
|
||||
artwork_url(album) {
|
||||
if (album.images && album.images.length > 0) {
|
||||
return album.images[0].url
|
||||
}
|
||||
return ''
|
||||
return album.images?.[0]?.url || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,10 +128,7 @@ export default {
|
|||
},
|
||||
|
||||
artwork_url(album) {
|
||||
if (album.images && album.images.length > 0) {
|
||||
return album.images[0].url
|
||||
}
|
||||
return ''
|
||||
return album.images?.[0]?.url || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -405,10 +405,7 @@ export default {
|
|||
|
||||
methods: {
|
||||
artwork_url(album) {
|
||||
if (album.images && album.images.length > 0) {
|
||||
return album.images[0].url
|
||||
}
|
||||
return ''
|
||||
return album.images?.[0]?.url || ''
|
||||
},
|
||||
new_search() {
|
||||
if (!this.search_query) {
|
||||
|
|
Loading…
Reference in New Issue