2018-12-15 03:56:09 -05:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<transition name="fade">
|
|
|
|
<div class="modal is-active" v-if="show">
|
|
|
|
<div class="modal-background" @click="$emit('close')"></div>
|
|
|
|
<div class="modal-content fd-modal-card">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2020-04-20 13:09:07 -04:00
|
|
|
<cover-artwork
|
|
|
|
:artwork_url="album.artwork_url"
|
|
|
|
:artist="album.artist"
|
|
|
|
:album="album.name"
|
|
|
|
class="image is-square fd-has-margin-bottom fd-has-shadow" />
|
2018-12-15 03:56:09 -05:00
|
|
|
<p class="title is-4">
|
|
|
|
<a class="has-text-link" @click="open_album">{{ album.name }}</a>
|
|
|
|
</p>
|
2020-09-20 02:13:19 -04:00
|
|
|
<div class="buttons" v-if="media_kind_resolved === 'podcast'">
|
2020-04-20 13:09:07 -04:00
|
|
|
<a class="button is-small" @click="mark_played">Mark as played</a>
|
2020-09-20 06:25:38 -04:00
|
|
|
<a class="button is-small" @click="$emit('remove-podcast')">Remove podcast</a>
|
2020-04-12 01:29:07 -04:00
|
|
|
</div>
|
2018-12-15 03:56:09 -05:00
|
|
|
<div class="content is-small">
|
2020-09-20 02:13:19 -04:00
|
|
|
<p v-if="album.artist">
|
2018-12-15 03:56:09 -05:00
|
|
|
<span class="heading">Album artist</span>
|
|
|
|
<a class="title is-6 has-text-link" @click="open_artist">{{ album.artist }}</a>
|
|
|
|
</p>
|
2020-09-01 14:56:57 -04:00
|
|
|
<p v-if="album.date_released">
|
|
|
|
<span class="heading">Release date</span>
|
2022-02-19 00:18:01 -05:00
|
|
|
<span class="title is-6">{{ $filters.time(album.date_released, 'L') }}</span>
|
2020-09-01 14:56:57 -04:00
|
|
|
</p>
|
|
|
|
<p v-else-if="album.year > 0">
|
|
|
|
<span class="heading">Year</span>
|
|
|
|
<span class="title is-6">{{ album.year }}</span>
|
|
|
|
</p>
|
2018-12-15 03:56:09 -05:00
|
|
|
<p>
|
|
|
|
<span class="heading">Tracks</span>
|
|
|
|
<span class="title is-6">{{ album.track_count }}</span>
|
|
|
|
</p>
|
2020-09-01 14:56:57 -04:00
|
|
|
<p>
|
|
|
|
<span class="heading">Length</span>
|
2022-02-19 00:18:01 -05:00
|
|
|
<span class="title is-6">{{ $filters.duration(album.length_ms) }}</span>
|
2020-09-01 14:56:57 -04:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading">Type</span>
|
|
|
|
<span class="title is-6">{{ album.media_kind }} - {{ album.data_kind }}</span>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading">Added at</span>
|
2022-02-19 00:18:01 -05:00
|
|
|
<span class="title is-6">{{ $filters.time(album.time_added, 'L LT') }}</span>
|
2020-09-01 14:56:57 -04:00
|
|
|
</p>
|
2018-12-15 03:56:09 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<footer class="card-footer">
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add">
|
2018-12-19 11:33:45 -05:00
|
|
|
<span class="icon"><i class="mdi mdi-playlist-plus"></i></span> <span class="is-size-7">Add</span>
|
2018-12-15 03:56:09 -05:00
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
2018-12-19 11:33:45 -05:00
|
|
|
<span class="icon"><i class="mdi mdi-playlist-play"></i></span> <span class="is-size-7">Add Next</span>
|
2018-12-15 03:56:09 -05:00
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="play">
|
2018-12-19 11:33:45 -05:00
|
|
|
<span class="icon"><i class="mdi mdi-play"></i></span> <span class="is-size-7">Play</span>
|
2018-12-15 03:56:09 -05:00
|
|
|
</a>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button class="modal-close is-large" aria-label="close" @click="$emit('close')"></button>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 00:18:01 -05:00
|
|
|
import CoverArtwork from '@/components/CoverArtwork.vue'
|
2018-12-15 03:56:09 -05:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ModalDialogAlbum',
|
2020-04-20 13:09:07 -04:00
|
|
|
components: { CoverArtwork },
|
2020-04-12 01:29:07 -04:00
|
|
|
props: ['show', 'album', 'media_kind', 'new_tracks'],
|
2018-12-15 03:56:09 -05:00
|
|
|
|
2018-12-15 09:12:39 -05:00
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
artwork_visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
artwork_url: function () {
|
2019-07-06 03:21:47 -04:00
|
|
|
return webapi.artwork_url_append_size_params(this.album.artwork_url)
|
2020-09-20 02:13:19 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
media_kind_resolved: function () {
|
|
|
|
return this.media_kind ? this.media_kind : this.album.media_kind
|
2018-12-15 09:12:39 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-15 03:56:09 -05:00
|
|
|
methods: {
|
|
|
|
play: function () {
|
|
|
|
this.$emit('close')
|
|
|
|
webapi.player_play_uri(this.album.uri, false)
|
|
|
|
},
|
|
|
|
|
|
|
|
queue_add: function () {
|
|
|
|
this.$emit('close')
|
2018-12-23 03:54:02 -05:00
|
|
|
webapi.queue_add(this.album.uri)
|
2018-12-15 03:56:09 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
queue_add_next: function () {
|
|
|
|
this.$emit('close')
|
2018-12-23 03:54:02 -05:00
|
|
|
webapi.queue_add_next(this.album.uri)
|
2018-12-15 03:56:09 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
open_album: function () {
|
2020-09-20 02:13:19 -04:00
|
|
|
if (this.media_kind_resolved === 'podcast') {
|
2018-12-15 03:56:09 -05:00
|
|
|
this.$router.push({ path: '/podcasts/' + this.album.id })
|
2020-09-20 02:13:19 -04:00
|
|
|
} else if (this.media_kind_resolved === 'audiobook') {
|
2018-12-15 03:56:09 -05:00
|
|
|
this.$router.push({ path: '/audiobooks/' + this.album.id })
|
|
|
|
} else {
|
|
|
|
this.$router.push({ path: '/music/albums/' + this.album.id })
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
open_artist: function () {
|
2020-09-20 02:13:19 -04:00
|
|
|
if (this.media_kind_resolved === 'podcast') {
|
|
|
|
// No artist page for podcasts
|
|
|
|
} else if (this.media_kind_resolved === 'audiobook') {
|
|
|
|
this.$router.push({ path: '/audiobooks/artists/' + this.album.artist_id })
|
|
|
|
} else {
|
|
|
|
this.$router.push({ path: '/music/artists/' + this.album.artist_id })
|
|
|
|
}
|
2018-12-15 09:12:39 -05:00
|
|
|
},
|
|
|
|
|
2020-04-12 01:29:07 -04:00
|
|
|
mark_played: function () {
|
|
|
|
webapi.library_album_track_update(this.album.id, { play_count: 'played' }).then(({ data }) => {
|
2020-10-18 03:42:00 -04:00
|
|
|
this.$emit('play-count-changed')
|
2020-04-12 01:29:07 -04:00
|
|
|
this.$emit('close')
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2018-12-15 09:12:39 -05:00
|
|
|
artwork_loaded: function () {
|
|
|
|
this.artwork_visible = true
|
|
|
|
},
|
|
|
|
|
|
|
|
artwork_error: function () {
|
|
|
|
this.artwork_visible = false
|
2018-12-15 03:56:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|