[web] Streamline method names

This commit is contained in:
Alain Nussbaumer 2024-03-26 01:29:05 +01:00
parent 3ceb76b016
commit 0086dde94b
3 changed files with 11 additions and 28 deletions

View File

@ -7,12 +7,8 @@
v-text="album.index" v-text="album.index"
/> />
</div> </div>
<div <div v-else class="media is-align-items-center" @click="open(album.item)">
v-else <div v-if="show_artwork" class="media-left">
class="media is-align-items-center"
@click="open_album(album.item)"
>
<div v-if="is_visible_artwork" class="media-left">
<cover-artwork <cover-artwork
:artwork_url="album.item.artwork_url" :artwork_url="album.item.artwork_url"
:artist="album.item.artist" :artist="album.item.artist"
@ -93,20 +89,19 @@ export default {
}, },
computed: { computed: {
is_visible_artwork() { media_kind_resolved() {
return this.media_kind || this.selected_album.media_kind
},
show_artwork() {
return this.$store.getters.settings_option( return this.$store.getters.settings_option(
'webinterface', 'webinterface',
'show_cover_artwork_in_album_lists' 'show_cover_artwork_in_album_lists'
).value ).value
},
media_kind_resolved() {
return this.media_kind || this.selected_album.media_kind
} }
}, },
methods: { methods: {
open_album(album) { open(album) {
this.selected_album = album this.selected_album = album
if (this.media_kind_resolved === 'podcast') { if (this.media_kind_resolved === 'podcast') {
this.$router.push({ name: 'podcast', params: { id: album.id } }) this.$router.push({ name: 'podcast', params: { id: album.id } })
@ -119,12 +114,10 @@ export default {
this.$router.push({ name: 'music-album', params: { id: album.id } }) this.$router.push({ name: 'music-album', params: { id: album.id } })
} }
}, },
open_dialog(album) { open_dialog(album) {
this.selected_album = album this.selected_album = album
this.show_details_modal = true this.show_details_modal = true
}, },
open_remove_podcast_dialog() { open_remove_podcast_dialog() {
webapi webapi
.library_album_tracks(this.selected_album.id, { limit: 1 }) .library_album_tracks(this.selected_album.id, { limit: 1 })
@ -138,11 +131,9 @@ export default {
}) })
}) })
}, },
play_count_changed() { play_count_changed() {
this.$emit('play-count-changed') this.$emit('play-count-changed')
}, },
remove_podcast() { remove_podcast() {
this.show_remove_podcast_modal = false this.show_remove_podcast_modal = false
webapi webapi

View File

@ -12,11 +12,7 @@
class="fd-has-shadow fd-cover fd-cover-normal-image mb-5" class="fd-has-shadow fd-cover fd-cover-normal-image mb-5"
/> />
<p class="title is-4"> <p class="title is-4">
<a <a class="has-text-link" @click="open" v-text="album.name" />
class="has-text-link"
@click="open_album"
v-text="album.name"
/>
</p> </p>
<div v-if="media_kind_resolved === 'podcast'" class="buttons"> <div v-if="media_kind_resolved === 'podcast'" class="buttons">
<a <a
@ -146,7 +142,7 @@ export default {
this.$emit('close') this.$emit('close')
}) })
}, },
open_album() { open() {
this.$emit('close') this.$emit('close')
if (this.media_kind_resolved === 'podcast') { if (this.media_kind_resolved === 'podcast') {
this.$router.push({ name: 'podcast', params: { id: this.album.id } }) this.$router.push({ name: 'podcast', params: { id: this.album.id } })

View File

@ -14,11 +14,7 @@
@error="artwork_error" @error="artwork_error"
/> />
<p class="title is-4"> <p class="title is-4">
<a <a class="has-text-link" @click="open" v-text="album.name" />
class="has-text-link"
@click="open_album"
v-text="album.name"
/>
</p> </p>
<div class="content is-small"> <div class="content is-small">
<p> <p>
@ -108,7 +104,7 @@ export default {
artwork_url(album) { artwork_url(album) {
return album.images?.[0]?.url || '' return album.images?.[0]?.url || ''
}, },
open_album() { open() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
name: 'music-spotify-album', name: 'music-spotify-album',