[web] Fix for list of tracks not playing from the correct position

This commit is contained in:
Alain Nussbaumer 2023-07-26 08:07:51 +02:00
parent c513e0044e
commit 9964018f0e

View File

@ -1,5 +1,5 @@
<template>
<template v-for="(track, index) in tracks" :key="track.itemId">
<template v-for="track in tracks" :key="track.itemId">
<div v-if="!track.isItem" class="mt-6 mb-5 py-2">
<span
:id="'index_' + track.groupKey"
@ -8,10 +8,10 @@
/>
</div>
<div
v-else-if="track.isItem"
v-else
class="media is-align-items-center"
:class="{ 'with-progress': show_progress }"
@click="play_track(index, track.item)"
@click="play_track(track.item)"
>
<figure v-if="show_icon" class="media-left is-clickable">
<mdicon class="icon" name="file-outline" size="16" />
@ -70,11 +70,11 @@ export default {
},
methods: {
play_track(position, track) {
play_track(track) {
if (this.uris) {
webapi.player_play_uri(this.uris, false, position)
webapi.player_play_uri(this.uris, false, this.tracks.items.indexOf(track))
} else if (this.expression) {
webapi.player_play_expression(this.expression, false, position)
webapi.player_play_expression(this.expression, false, this.tracks.items.indexOf(track))
} else {
webapi.player_play_uri(track.uri, false)
}