[web] Simplify method artwork_url
This commit is contained in:
parent
1936ce6621
commit
8aa2b3d5ac
|
@ -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 ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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 ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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 ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue