2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
|
|
|
<content-with-heading>
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-4">{{ artist.name }}</p>
|
|
|
|
</template>
|
2018-10-27 01:18:41 -04:00
|
|
|
<template slot="heading-right">
|
2019-02-17 05:24:30 -05:00
|
|
|
<div class="buttons is-centered">
|
|
|
|
<a class="button is-small is-light is-rounded" @click="show_artist_details_modal = true">
|
|
|
|
<span class="icon"><i class="mdi mdi-dots-horizontal mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
<a class="button is-small is-dark is-rounded" @click="play">
|
|
|
|
<span class="icon"><i class="mdi mdi-shuffle"></i></span> <span>Shuffle</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2018-10-27 01:18:41 -04:00
|
|
|
</template>
|
2018-08-11 01:47:10 -04:00
|
|
|
<template slot="content">
|
2018-10-26 11:36:30 -04:00
|
|
|
<p class="heading has-text-centered-mobile">{{ artist.album_count }} albums | <a class="has-text-link" @click="open_tracks">{{ artist.track_count }} tracks</a></p>
|
2018-12-16 03:17:43 -05:00
|
|
|
<list-item-album v-for="album in albums.items" :key="album.id" :album="album" @click="open_album(album)">
|
2018-12-15 03:56:09 -05:00
|
|
|
<template slot="actions">
|
|
|
|
<a @click="open_dialog(album)">
|
|
|
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</list-item-album>
|
|
|
|
<modal-dialog-album :show="show_details_modal" :album="selected_album" @close="show_details_modal = false" />
|
2019-02-17 05:24:30 -05:00
|
|
|
<modal-dialog-artist :show="show_artist_details_modal" :artist="artist" @close="show_artist_details_modal = false" />
|
2018-08-11 01:47:10 -04:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
|
|
|
import ListItemAlbum from '@/components/ListItemAlbum'
|
2018-12-15 03:56:09 -05:00
|
|
|
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
2019-02-17 05:24:30 -05:00
|
|
|
import ModalDialogArtist from '@/components/ModalDialogArtist'
|
2018-08-11 01:47:10 -04:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
const artistData = {
|
|
|
|
load: function (to) {
|
|
|
|
return Promise.all([
|
|
|
|
webapi.library_artist(to.params.artist_id),
|
2020-06-30 04:24:11 -04:00
|
|
|
webapi.library_artist_albums(to.params.artist_id)
|
2018-08-11 01:47:10 -04:00
|
|
|
])
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
|
|
|
vm.artist = response[0].data
|
|
|
|
vm.albums = response[1].data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageArtist',
|
2020-04-11 13:43:53 -04:00
|
|
|
mixins: [LoadDataBeforeEnterMixin(artistData)],
|
2019-02-17 05:24:30 -05:00
|
|
|
components: { ContentWithHeading, ListItemAlbum, ModalDialogAlbum, ModalDialogArtist },
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
artist: {},
|
2018-12-15 03:56:09 -05:00
|
|
|
albums: {},
|
|
|
|
|
|
|
|
show_details_modal: false,
|
2019-02-17 05:24:30 -05:00
|
|
|
selected_album: {},
|
|
|
|
|
|
|
|
show_artist_details_modal: false
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2018-10-26 11:36:30 -04:00
|
|
|
open_tracks: function () {
|
|
|
|
this.$router.push({ path: '/music/artists/' + this.artist.id + '/tracks' })
|
2018-10-27 01:18:41 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
play: function () {
|
2018-11-06 15:44:01 -05:00
|
|
|
webapi.player_play_uri(this.albums.items.map(a => a.uri).join(','), true)
|
2018-12-15 03:56:09 -05:00
|
|
|
},
|
|
|
|
|
2018-12-16 03:17:43 -05:00
|
|
|
open_album: function (album) {
|
|
|
|
this.$router.push({ path: '/music/albums/' + album.id })
|
|
|
|
},
|
|
|
|
|
2018-12-15 03:56:09 -05:00
|
|
|
open_dialog: function (album) {
|
|
|
|
this.selected_album = album
|
|
|
|
this.show_details_modal = true
|
2018-10-26 11:36:30 -04:00
|
|
|
}
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|