[web] Fix for Spotify playlist not being played properly

If a Spotify playlist is containing unplayable tracks (e.g., wrong market), the position of the subsequent tracks in the playlist must be changed accordingly.
Moreover, the album property was provided for no reason.
This commit is contained in:
Alain Nussbaumer
2023-06-10 18:25:12 +02:00
parent 3b81791cd0
commit 6a2f85e04f
4 changed files with 27 additions and 13 deletions

View File

@@ -1,6 +1,12 @@
<template>
<div class="media">
<div class="media-content fd-has-action is-clipped" @click="play">
<div
class="media-content is-clipped"
:class="{
'is-clickable': track.is_playable
}"
@click="play"
>
<h1
class="title is-6"
:class="{ 'has-text-grey-light': !track.is_playable }"
@@ -37,10 +43,12 @@ import webapi from '@/webapi'
export default {
name: 'SpotifyListItemTrack',
props: ['track', 'position', 'album', 'context_uri'],
props: ['track', 'position', 'context_uri'],
methods: {
play() {
webapi.player_play_uri(this.context_uri, false, this.position)
if (this.track.is_playable) {
webapi.player_play_uri(this.context_uri, false, this.position)
}
}
}
}