2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2023-11-29 01:27:48 +01:00
|
|
|
<div>
|
2023-06-24 10:56:00 +02:00
|
|
|
<content-with-hero>
|
|
|
|
<template #heading-left>
|
|
|
|
<h1 class="title is-5" v-text="album.name" />
|
2023-12-09 10:46:30 +01:00
|
|
|
<h2 class="subtitle is-6 has-text-link">
|
2023-06-24 10:56:00 +02:00
|
|
|
<a class="has-text-link" @click="open_artist" v-text="album.artist" />
|
|
|
|
</h2>
|
2023-07-01 09:48:38 +02:00
|
|
|
<div class="buttons fd-is-centered-mobile mt-5">
|
2023-06-24 10:56:00 +02:00
|
|
|
<a class="button is-small is-dark is-rounded" @click="play">
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="play" size="16" />
|
2023-06-24 10:56:00 +02:00
|
|
|
<span v-text="$t('page.audiobooks.album.play')" />
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
class="button is-small is-light is-rounded"
|
2023-12-07 21:31:10 +01:00
|
|
|
@click="show_details_modal = true"
|
2023-06-24 10:56:00 +02:00
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="dots-horizontal" size="16" />
|
2023-06-24 10:56:00 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template #heading-right>
|
|
|
|
<cover-artwork
|
|
|
|
:artwork_url="album.artwork_url"
|
|
|
|
:artist="album.artist"
|
|
|
|
:album="album.name"
|
|
|
|
class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
|
2023-12-07 21:31:10 +01:00
|
|
|
@click="show_details_modal = true"
|
2023-06-24 10:56:00 +02:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #content>
|
|
|
|
<p
|
2024-03-13 18:14:55 +01:00
|
|
|
class="heading has-text-centered-mobile mt-5"
|
2023-06-24 10:56:00 +02:00
|
|
|
v-text="
|
|
|
|
$t('page.audiobooks.album.track-count', {
|
|
|
|
count: album.track_count
|
|
|
|
})
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
<list-tracks :tracks="tracks" :uris="album.uri" />
|
|
|
|
<modal-dialog-album
|
2023-12-07 21:31:10 +01:00
|
|
|
:show="show_details_modal"
|
2023-06-24 10:56:00 +02:00
|
|
|
:album="album"
|
|
|
|
:media_kind="'audiobook'"
|
2023-12-07 21:31:10 +01:00
|
|
|
@close="show_details_modal = false"
|
2023-06-24 10:56:00 +02:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</content-with-hero>
|
|
|
|
</div>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 06:18:01 +01:00
|
|
|
import ContentWithHero from '@/templates/ContentWithHero.vue'
|
2023-07-10 09:52:52 +02:00
|
|
|
import CoverArtwork from '@/components/CoverArtwork.vue'
|
2024-02-22 19:32:11 +01:00
|
|
|
import { GroupedList } from '@/lib/GroupedList'
|
2022-02-19 06:18:01 +01:00
|
|
|
import ListTracks from '@/components/ListTracks.vue'
|
|
|
|
import ModalDialogAlbum from '@/components/ModalDialogAlbum.vue'
|
2018-08-11 07:47:10 +02:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
2022-02-19 06:18:01 +01:00
|
|
|
const dataObject = {
|
2023-06-07 21:25:54 +02:00
|
|
|
load(to) {
|
2018-08-11 07:47:10 +02:00
|
|
|
return Promise.all([
|
2023-07-10 09:52:52 +02:00
|
|
|
webapi.library_album(to.params.id),
|
|
|
|
webapi.library_album_tracks(to.params.id)
|
2018-08-11 07:47:10 +02:00
|
|
|
])
|
|
|
|
},
|
|
|
|
|
2023-06-07 21:25:54 +02:00
|
|
|
set(vm, response) {
|
2018-08-11 07:47:10 +02:00
|
|
|
vm.album = response[0].data
|
2024-02-22 19:32:11 +01:00
|
|
|
vm.tracks = new GroupedList(response[1].data)
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2020-09-20 08:15:46 +02:00
|
|
|
name: 'PageAudiobooksAlbum',
|
2023-07-10 09:52:52 +02:00
|
|
|
components: { ContentWithHero, CoverArtwork, ListTracks, ModalDialogAlbum },
|
2018-08-11 07:47:10 +02:00
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
next((vm) => dataObject.set(vm, response))
|
|
|
|
})
|
|
|
|
},
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
const vm = this
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
dataObject.set(vm, response)
|
|
|
|
next()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
2018-08-11 07:47:10 +02:00
|
|
|
return {
|
|
|
|
album: {},
|
2023-12-07 21:31:10 +01:00
|
|
|
show_details_modal: false,
|
2024-02-22 19:32:11 +01:00
|
|
|
tracks: new GroupedList()
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-07 21:25:54 +02:00
|
|
|
open_artist() {
|
2020-09-20 08:21:52 +02:00
|
|
|
this.show_details_modal = false
|
2023-07-10 20:08:35 +02:00
|
|
|
this.$router.push({
|
|
|
|
name: 'audiobooks-artist',
|
|
|
|
params: { id: this.album.artist_id }
|
|
|
|
})
|
2020-09-20 08:21:52 +02:00
|
|
|
},
|
|
|
|
|
2023-06-07 21:25:54 +02:00
|
|
|
play() {
|
2018-11-06 21:44:01 +01:00
|
|
|
webapi.player_play_uri(this.album.uri, false)
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|