fix player status, scroll to current item on start

This commit is contained in:
jb-alvarado 2024-09-13 07:31:32 +02:00
parent 5601698f91
commit e4baf19000
2 changed files with 8 additions and 1 deletions

View File

@ -271,6 +271,7 @@ watch([data], () => {
playlistStore.setStatus(playout_status)
} catch {
indexStore.sseConnected = true
playlistStore.playoutIsRunning = false
resetStatus()
}
}

View File

@ -140,7 +140,7 @@ const playlistContainer = ref()
const sortContainer = ref()
const todayDate = ref($dayjs().utcOffset(configStore.utcOffset).format('YYYY-MM-DD'))
const { id } = storeToRefs(useConfig())
const { currentIndex, listDate } = storeToRefs(usePlaylist())
const { currentIndex, listDate, playoutIsRunning } = storeToRefs(usePlaylist())
const playlistSortOptions = {
group: 'playlist',
@ -175,6 +175,12 @@ watch([listDate, id], () => {
}, 800)
})
watch([playoutIsRunning], () => {
setTimeout(() => {
scrollTo(currentIndex.value)
}, 400)
})
defineExpose({
classSwitcher,
getPlaylist,