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) playlistStore.setStatus(playout_status)
} catch { } catch {
indexStore.sseConnected = true indexStore.sseConnected = true
playlistStore.playoutIsRunning = false
resetStatus() resetStatus()
} }
} }

View File

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