2018-12-17 05:52:09 -05:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<transition name="fade">
|
2022-02-19 00:39:14 -05:00
|
|
|
<div v-if="show" class="modal is-active">
|
|
|
|
<div class="modal-background" @click="$emit('close')" />
|
2018-12-17 05:52:09 -05:00
|
|
|
<div class="modal-content fd-modal-card">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2022-02-19 00:39:14 -05:00
|
|
|
<figure
|
|
|
|
v-show="artwork_visible"
|
|
|
|
class="image is-square fd-has-margin-bottom"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="artwork_url"
|
|
|
|
class="fd-has-shadow"
|
|
|
|
@load="artwork_loaded"
|
|
|
|
@error="artwork_error"
|
|
|
|
/>
|
2018-12-19 07:13:29 -05:00
|
|
|
</figure>
|
2018-12-17 05:52:09 -05:00
|
|
|
<p class="title is-4">
|
2022-02-19 00:39:14 -05:00
|
|
|
<a class="has-text-link" @click="open_album">{{
|
|
|
|
album.name
|
|
|
|
}}</a>
|
2018-12-17 05:52:09 -05:00
|
|
|
</p>
|
|
|
|
<div class="content is-small">
|
|
|
|
<p>
|
|
|
|
<span class="heading">Album artist</span>
|
2022-02-19 00:39:14 -05:00
|
|
|
<a class="title is-6 has-text-link" @click="open_artist">{{
|
|
|
|
album.artists[0].name
|
|
|
|
}}</a>
|
2018-12-17 05:52:09 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading">Release date</span>
|
2022-02-19 00:39:14 -05:00
|
|
|
<span class="title is-6">{{
|
2022-04-15 13:47:36 -04:00
|
|
|
$filters.date(album.release_date)
|
2022-02-19 00:39:14 -05:00
|
|
|
}}</span>
|
2018-12-17 05:52:09 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<span class="heading">Type</span>
|
|
|
|
<span class="title is-6">{{ album.album_type }}</span>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<footer class="card-footer">
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add">
|
2022-04-16 04:14:03 -04:00
|
|
|
<span class="icon"
|
|
|
|
><mdicon name="playlist-plus" size="16"
|
|
|
|
/></span>
|
2022-02-19 00:39:14 -05:00
|
|
|
<span class="is-size-7">Add</span>
|
2018-12-17 05:52:09 -05:00
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
2022-04-16 04:14:03 -04:00
|
|
|
<span class="icon"
|
|
|
|
><mdicon name="playlist-play" size="16"
|
|
|
|
/></span>
|
2022-02-19 00:39:14 -05:00
|
|
|
<span class="is-size-7">Add Next</span>
|
2018-12-17 05:52:09 -05:00
|
|
|
</a>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="play">
|
2022-04-16 04:14:03 -04:00
|
|
|
<span class="icon"><mdicon name="play" size="16" /></span>
|
2022-02-19 00:39:14 -05:00
|
|
|
<span class="is-size-7">Play</span>
|
2018-12-17 05:52:09 -05:00
|
|
|
</a>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-19 00:39:14 -05:00
|
|
|
<button
|
|
|
|
class="modal-close is-large"
|
|
|
|
aria-label="close"
|
|
|
|
@click="$emit('close')"
|
|
|
|
/>
|
2018-12-17 05:52:09 -05:00
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'SpotifyModalDialogAlbum',
|
2020-04-11 13:43:53 -04:00
|
|
|
props: ['show', 'album'],
|
2022-02-19 01:05:59 -05:00
|
|
|
emits: ['close'],
|
2018-12-17 05:52:09 -05:00
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
data() {
|
2018-12-19 07:13:29 -05:00
|
|
|
return {
|
|
|
|
artwork_visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
artwork_url: function () {
|
|
|
|
if (this.album.images && this.album.images.length > 0) {
|
|
|
|
return this.album.images[0].url
|
|
|
|
}
|
|
|
|
return ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-17 05:52: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-17 05:52: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-17 05:52:09 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
open_album: function () {
|
|
|
|
this.$router.push({ path: '/music/spotify/albums/' + this.album.id })
|
|
|
|
},
|
|
|
|
|
|
|
|
open_artist: function () {
|
2022-02-19 00:39:14 -05:00
|
|
|
this.$router.push({
|
|
|
|
path: '/music/spotify/artists/' + this.album.artists[0].id
|
|
|
|
})
|
2018-12-19 07:13:29 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
artwork_loaded: function () {
|
|
|
|
this.artwork_visible = true
|
|
|
|
},
|
|
|
|
|
|
|
|
artwork_error: function () {
|
|
|
|
this.artwork_visible = false
|
2018-12-17 05:52:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|