Added spotify player

This commit is contained in:
2020-11-26 21:18:34 +01:00
parent 60f026b6d9
commit 9dc4a1a25c
5 changed files with 95 additions and 19 deletions

View File

@ -9,7 +9,8 @@
<b-row v-else>
<b-col class="my-4">
<b-table :items="tracklist" :fields="fields" hover borderless @row-clicked="rowClicked" tbody-tr-class="clickable-table-row-thing">
<b-table :items="tracklist" :fields="fields" hover borderless @row-clicked="rowClicked"
tbody-tr-class="clickable-table-row-thing">
<template #cell(cover_url)="data">
<b-img-lazy :src="data.item.cover_url_small" height="45px" blank-src="@/assets/music_placeholder.png"
v-if="!!data.item.cover_url_small"/>
@ -18,7 +19,9 @@
<template #cell(id)="data">
<div class="text-right">
<b-button variant="success" :disabled="!data.item.spotify_id">Play</b-button>
<b-button variant="success" :disabled="!data.item.spotify_id" @click="startPlayer(data.item.spotify_id)">
Play
</b-button>
</div>
</template>
</b-table>
@ -60,6 +63,9 @@ export default {
methods: {
rowClicked(data) {
this.$router.push({name: 'Item', params: {id: data.id}});
},
startPlayer(spotify_id) {
this.$store.dispatch('openPlayer', spotify_id);
}
},
mounted() {