diff --git a/components/PlayerControl.vue b/components/PlayerControl.vue index fcea1813..dabf766d 100644 --- a/components/PlayerControl.vue +++ b/components/PlayerControl.vue @@ -243,7 +243,7 @@ watch([status, error], async () => { indexStore.sseConnected = false errorCounter.value += 1 - if (errorCounter.value > 15) { + if (errorCounter.value > 11) { await authStore.obtainUuid() streamUrl.value = `/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=playout&uuid=${ authStore.uuid diff --git a/components/PlaylistTable.vue b/components/PlaylistTable.vue index 51ae3aef..7a148b2e 100644 --- a/components/PlaylistTable.vue +++ b/components/PlaylistTable.vue @@ -137,6 +137,7 @@ const { processPlaylist, genUID } = playlistOperations() const playlistContainer = ref() const sortContainer = ref() const todayDate = ref($dayjs().utcOffset(configStore.utcOffset).format('YYYY-MM-DD')) +const { configID } = storeToRefs(useConfig()) const { currentClipIndex, listDate } = storeToRefs(usePlaylist()) const playlistSortOptions = { @@ -164,8 +165,11 @@ onMounted(() => { getPlaylist() }) -watch([listDate], () => { +watch([listDate, configID], () => { getPlaylist() + setTimeout(() => { + getPlaylist() + }, 800) }) defineExpose({ diff --git a/stores/playlist.ts b/stores/playlist.ts index 45e5ea6c..94f47292 100644 --- a/stores/playlist.ts +++ b/stores/playlist.ts @@ -26,6 +26,7 @@ export const usePlaylist = defineStore('playlist', { elapsedSec: 0, shift: 0, playoutIsRunning: false, + last_channel: 0, }), getters: {}, @@ -46,6 +47,7 @@ export const usePlaylist = defineStore('playlist', { const programData = processPlaylist(date, data.program, false) if ( + channel === this.last_channel && this.playlist.length > 0 && programData.length > 0 && (this.playlist[0].date === date || configStore.playout.playlist.infinit) && @@ -64,12 +66,18 @@ export const usePlaylist = defineStore('playlist', { indexStore.msgAlert('error', e.data, 5) } else if (e.status >= 400) { indexStore.msgAlert('error', e.data, 5) - } else if (this.playlist.length > 0 && this.playlist[0].date === date) { + } else if ( + channel === this.last_channel && + this.playlist.length > 0 && + this.playlist[0].date === date + ) { indexStore.msgAlert('warning', $i18n.t('player.unsavedProgram'), 3) } else { this.playlist = [] } }) + + this.last_channel = channel }, setStatus(item: PlayoutStatus) {