From 4e0f49792c4ca5a94352bb6adc5ebda3bdb2afad Mon Sep 17 00:00:00 2001 From: Thomas Amland Date: Sat, 15 Aug 2020 09:32:59 +0200 Subject: [PATCH] add play button to album page --- src/library/album/AlbumDetails.vue | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/library/album/AlbumDetails.vue b/src/library/album/AlbumDetails.vue index c7ee332..15d93c2 100644 --- a/src/library/album/AlbumDetails.vue +++ b/src/library/album/AlbumDetails.vue @@ -1,8 +1,10 @@ @@ -45,6 +52,16 @@ }, async mounted() { this.album = await this.$api.getAlbumDetails(this.id) + }, + methods: { + play() { + if (this.album?.tracks) { + return this.$store.dispatch('player/playQueue', { + index: 0, + queue: this.album.tracks, + }) + } + }, } })