2018-12-15 09:56:09 +01:00
|
|
|
<template>
|
2024-03-05 14:21:35 +01:00
|
|
|
<transition name="fade">
|
|
|
|
<div v-if="show" class="modal is-active">
|
|
|
|
<div class="modal-background" @click="$emit('close')" />
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
|
|
|
<cover-artwork
|
2024-03-26 03:13:17 +01:00
|
|
|
:artwork_url="item.artwork_url"
|
|
|
|
:artist="item.artist"
|
|
|
|
:album="item.name"
|
2024-03-05 14:21:35 +01:00
|
|
|
class="fd-has-shadow fd-cover fd-cover-normal-image mb-5"
|
|
|
|
/>
|
|
|
|
<p class="title is-4">
|
2024-03-26 03:13:17 +01:00
|
|
|
<a class="has-text-link" @click="open" v-text="item.name" />
|
2024-03-05 14:21:35 +01:00
|
|
|
</p>
|
|
|
|
<div v-if="media_kind_resolved === 'podcast'" class="buttons">
|
|
|
|
<a
|
|
|
|
class="button is-small"
|
|
|
|
@click="mark_played"
|
|
|
|
v-text="$t('dialog.album.mark-as-played')"
|
|
|
|
/>
|
|
|
|
<a
|
2024-03-26 03:13:17 +01:00
|
|
|
v-if="item.data_kind === 'url'"
|
2024-03-05 14:21:35 +01:00
|
|
|
class="button is-small"
|
|
|
|
@click="$emit('remove-podcast')"
|
|
|
|
v-text="$t('dialog.album.remove-podcast')"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="content is-small">
|
2024-03-26 03:13:17 +01:00
|
|
|
<p v-if="item.artist">
|
2024-03-05 14:21:35 +01:00
|
|
|
<span class="heading" v-text="$t('dialog.album.artist')" />
|
2022-05-29 18:49:00 +02:00
|
|
|
<a
|
2024-03-05 14:21:35 +01:00
|
|
|
class="title is-6 has-text-link"
|
|
|
|
@click="open_artist"
|
2024-03-26 03:13:17 +01:00
|
|
|
v-text="item.artist"
|
2022-05-29 18:49:00 +02:00
|
|
|
/>
|
2018-12-15 09:56:09 +01:00
|
|
|
</p>
|
2024-03-26 03:13:17 +01:00
|
|
|
<p v-if="item.date_released">
|
2024-03-05 14:21:35 +01:00
|
|
|
<span
|
|
|
|
class="heading"
|
|
|
|
v-text="$t('dialog.album.release-date')"
|
2022-05-29 18:49:00 +02:00
|
|
|
/>
|
2024-03-05 14:21:35 +01:00
|
|
|
<span
|
|
|
|
class="title is-6"
|
2024-03-26 03:13:17 +01:00
|
|
|
v-text="$filters.date(item.date_released)"
|
2024-03-05 14:21:35 +01:00
|
|
|
/>
|
|
|
|
</p>
|
2024-03-26 03:13:17 +01:00
|
|
|
<p v-else-if="item.year">
|
2024-03-05 14:21:35 +01:00
|
|
|
<span class="heading" v-text="$t('dialog.album.year')" />
|
2024-03-26 03:13:17 +01:00
|
|
|
<span class="title is-6" v-text="item.year" />
|
2024-03-05 14:21:35 +01:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading" v-text="$t('dialog.album.tracks')" />
|
2024-03-26 03:13:17 +01:00
|
|
|
<span class="title is-6" v-text="item.track_count" />
|
2024-03-05 14:21:35 +01:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading" v-text="$t('dialog.album.duration')" />
|
|
|
|
<span
|
|
|
|
class="title is-6"
|
2024-03-26 03:13:17 +01:00
|
|
|
v-text="$filters.durationInHours(item.length_ms)"
|
2024-03-05 14:21:35 +01:00
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading" v-text="$t('dialog.album.type')" />
|
|
|
|
<span
|
|
|
|
class="title is-6"
|
|
|
|
v-text="
|
2024-03-26 03:34:50 +01:00
|
|
|
`${$t(`media.kind.${item.media_kind}`)} - ${$t(`data.kind.${item.data_kind}`)}`
|
2024-03-05 14:21:35 +01:00
|
|
|
"
|
2022-05-29 18:49:00 +02:00
|
|
|
/>
|
2024-03-05 14:21:35 +01:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading" v-text="$t('dialog.album.added-on')" />
|
|
|
|
<span
|
|
|
|
class="title is-6"
|
2024-03-26 03:13:17 +01:00
|
|
|
v-text="$filters.datetime(item.time_added)"
|
2024-03-05 14:21:35 +01:00
|
|
|
/>
|
|
|
|
</p>
|
2018-12-15 09:56:09 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-05 14:21:35 +01:00
|
|
|
<footer class="card-footer">
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
|
|
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
|
|
<span class="is-size-7" v-text="$t('dialog.album.add')" />
|
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
|
|
<mdicon class="icon" name="playlist-play" size="16" />
|
|
|
|
<span class="is-size-7" v-text="$t('dialog.album.add-next')" />
|
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="play">
|
|
|
|
<mdicon class="icon" name="play" size="16" />
|
|
|
|
<span class="is-size-7" v-text="$t('dialog.album.play')" />
|
|
|
|
</a>
|
|
|
|
</footer>
|
2018-12-15 09:56:09 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-05 14:21:35 +01:00
|
|
|
<button
|
|
|
|
class="modal-close is-large"
|
|
|
|
aria-label="close"
|
|
|
|
@click="$emit('close')"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2018-12-15 09:56:09 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 06:18:01 +01:00
|
|
|
import CoverArtwork from '@/components/CoverArtwork.vue'
|
2018-12-15 09:56:09 +01:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ModalDialogAlbum',
|
2020-04-20 19:09:07 +02:00
|
|
|
components: { CoverArtwork },
|
2024-02-27 17:18:58 +01:00
|
|
|
props: {
|
2024-03-26 03:13:17 +01:00
|
|
|
item: { required: true, type: Object },
|
2024-02-28 13:10:08 +01:00
|
|
|
media_kind: { default: '', type: String },
|
|
|
|
show: Boolean
|
2024-02-27 17:18:58 +01:00
|
|
|
},
|
2022-02-19 07:05:59 +01:00
|
|
|
emits: ['close', 'remove-podcast', 'play-count-changed'],
|
2018-12-15 09:56:09 +01:00
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
data() {
|
2018-12-15 15:12:39 +01:00
|
|
|
return {
|
|
|
|
artwork_visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
2023-06-07 21:25:54 +02:00
|
|
|
media_kind_resolved() {
|
2024-03-26 03:13:17 +01:00
|
|
|
return this.media_kind || this.item.media_kind
|
2018-12-15 15:12:39 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-15 09:56:09 +01:00
|
|
|
methods: {
|
2024-03-26 01:17:07 +01:00
|
|
|
mark_played() {
|
|
|
|
webapi
|
2024-03-26 03:13:17 +01:00
|
|
|
.library_album_track_update(this.item.id, { play_count: 'played' })
|
2024-03-26 01:17:07 +01:00
|
|
|
.then(({ data }) => {
|
|
|
|
this.$emit('play-count-changed')
|
|
|
|
this.$emit('close')
|
|
|
|
})
|
2018-12-15 09:56:09 +01:00
|
|
|
},
|
2024-03-26 01:29:05 +01:00
|
|
|
open() {
|
2023-06-03 18:44:49 +02:00
|
|
|
this.$emit('close')
|
2020-09-20 08:13:19 +02:00
|
|
|
if (this.media_kind_resolved === 'podcast') {
|
2024-03-26 03:13:17 +01:00
|
|
|
this.$router.push({ name: 'podcast', params: { id: this.item.id } })
|
2020-09-20 08:13:19 +02:00
|
|
|
} else if (this.media_kind_resolved === 'audiobook') {
|
2023-07-10 20:08:35 +02:00
|
|
|
this.$router.push({
|
|
|
|
name: 'audiobooks-album',
|
2024-03-26 03:13:17 +01:00
|
|
|
params: { id: this.item.id }
|
2023-07-10 20:08:35 +02:00
|
|
|
})
|
2018-12-15 09:56:09 +01:00
|
|
|
} else {
|
2023-07-10 20:43:10 +02:00
|
|
|
this.$router.push({
|
|
|
|
name: 'music-album',
|
2024-03-26 03:13:17 +01:00
|
|
|
params: { id: this.item.id }
|
2023-07-10 20:43:10 +02:00
|
|
|
})
|
2018-12-15 09:56:09 +01:00
|
|
|
}
|
|
|
|
},
|
2023-06-07 21:25:54 +02:00
|
|
|
open_artist() {
|
2023-06-03 18:44:49 +02:00
|
|
|
this.$emit('close')
|
|
|
|
if (this.media_kind_resolved === 'audiobook') {
|
2022-02-19 06:39:14 +01:00
|
|
|
this.$router.push({
|
2023-07-10 20:08:35 +02:00
|
|
|
name: 'audiobooks-artist',
|
2024-03-26 03:13:17 +01:00
|
|
|
params: { id: this.item.artist_id }
|
2022-02-19 06:39:14 +01:00
|
|
|
})
|
2020-09-20 08:13:19 +02:00
|
|
|
} else {
|
2023-07-10 20:33:07 +02:00
|
|
|
this.$router.push({
|
|
|
|
name: 'music-artist',
|
2024-03-26 03:13:17 +01:00
|
|
|
params: { id: this.item.artist_id }
|
2023-07-10 20:33:07 +02:00
|
|
|
})
|
2020-09-20 08:13:19 +02:00
|
|
|
}
|
2018-12-15 15:12:39 +01:00
|
|
|
},
|
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)
|
2024-03-26 01:17:07 +01:00
|
|
|
},
|
|
|
|
queue_add() {
|
|
|
|
this.$emit('close')
|
2024-03-26 03:13:17 +01:00
|
|
|
webapi.queue_add(this.item.uri)
|
2024-03-26 01:17:07 +01:00
|
|
|
},
|
|
|
|
queue_add_next() {
|
|
|
|
this.$emit('close')
|
2024-03-26 03:13:17 +01:00
|
|
|
webapi.queue_add_next(this.item.uri)
|
2018-12-15 09:56:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|