owntone-server/web-src/src/components/ModalDialogArtist.vue

96 lines
2.3 KiB
Vue
Raw Normal View History

<template>
<modal-dialog-action
:actions="actions"
:show="show"
@add="queue_add"
@add-next="queue_add_next"
@close="$emit('close')"
@play="play"
>
<template #modal-content>
<div class="title is-4">
<a @click="open" v-text="item.name" />
</div>
<div class="mb-3">
<div
class="is-size-7 is-uppercase"
v-text="$t('dialog.artist.albums')"
/>
<div class="title is-6" v-text="item.album_count" />
</div>
<div class="mb-3">
<div
class="is-size-7 is-uppercase"
v-text="$t('dialog.artist.tracks')"
/>
<div class="title is-6" v-text="item.track_count" />
</div>
<div class="mb-3">
<div class="is-size-7 is-uppercase" v-text="$t('dialog.artist.type')" />
<div class="title is-6" v-text="$t(`data.kind.${item.data_kind}`)" />
</div>
<div class="mb-3">
<div
class="is-size-7 is-uppercase"
v-text="$t('dialog.artist.added-on')"
/>
<div class="title is-6" v-text="$filters.datetime(item.time_added)" />
</div>
</template>
</modal-dialog-action>
</template>
<script>
import ModalDialogAction from '@/components/ModalDialogAction.vue'
import webapi from '@/webapi'
export default {
name: 'ModalDialogArtist',
components: { ModalDialogAction },
2024-03-26 03:13:17 +01:00
props: { item: { required: true, type: Object }, show: Boolean },
2022-02-19 07:05:59 +01:00
emits: ['close'],
computed: {
actions() {
return [
{
label: this.$t('dialog.artist.add'),
event: 'add',
icon: 'playlist-plus'
},
{
label: this.$t('dialog.artist.add-next'),
event: 'add-next',
icon: 'playlist-play'
},
{
label: this.$t('dialog.artist.play'),
event: 'play',
icon: 'play'
}
]
}
},
methods: {
2024-03-26 03:13:17 +01:00
open() {
2024-03-26 01:17:07 +01:00
this.$emit('close')
this.$router.push({
name: 'music-artist',
2024-03-26 03:13:17 +01:00
params: { id: this.item.id }
2024-03-26 01:17:07 +01:00
})
},
play() {
this.$emit('close')
2024-03-26 03:13:17 +01:00
webapi.player_play_uri(this.item.uri, false)
},
queue_add() {
this.$emit('close')
2024-03-26 03:13:17 +01:00
webapi.queue_add(this.item.uri)
},
queue_add_next() {
this.$emit('close')
2024-03-26 03:13:17 +01:00
webapi.queue_add_next(this.item.uri)
}
}
}
</script>