From 55c6e70f4a4b0dff0b9e61ad9badd24267c3c995 Mon Sep 17 00:00:00 2001 From: arc-alex Date: Sat, 10 May 2025 20:07:03 +0200 Subject: [PATCH] rename --- .../server/src/services/runtime-service/RuntimeService.ts | 8 +++++--- .../src/services/runtime-service/rundownService.utils.ts | 6 +----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/server/src/services/runtime-service/RuntimeService.ts b/apps/server/src/services/runtime-service/RuntimeService.ts index 5ebdb3d1d..4009ba2f8 100644 --- a/apps/server/src/services/runtime-service/RuntimeService.ts +++ b/apps/server/src/services/runtime-service/RuntimeService.ts @@ -717,7 +717,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert const hasImmediateChanges = hasNewLoaded || justStarted || hasChangedPlayback || offsetModeChanged; // we would like the wall clock to tick on a regular rate - const beutyClockUpdate = getShouldClockUpdate(RuntimeService.previousClockUpdate, state.clock); + const normalClockUpdate = + getShouldClockUpdate(RuntimeService.previousClockUpdate, state.clock) || + getForceUpdate(RuntimeService.previousClockUpdate, state.clock); /** * Timer should be updated if @@ -743,7 +745,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert * Then check if there is actually a change in the data */ const shouldRuntimeUpdate = - (beutyClockUpdate || + (normalClockUpdate || hasImmediateChanges || shouldUpdateTimer || getForceUpdate(RuntimeService.previousRuntimeUpdate, state.clock)) && @@ -759,7 +761,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert * so if any of them are updated we also need to send the clock * in case nothing else is updating the clock will be updated at the notification rate */ - const shouldUpdateClock = shouldRuntimeUpdate || shouldBlockUpdate || beutyClockUpdate; + const shouldUpdateClock = shouldRuntimeUpdate || shouldBlockUpdate || normalClockUpdate; //Now we set all the updates on the eventstore and update the previous value if (hasChangedPlayback) { diff --git a/apps/server/src/services/runtime-service/rundownService.utils.ts b/apps/server/src/services/runtime-service/rundownService.utils.ts index 99c5fbe9e..a551d64f2 100644 --- a/apps/server/src/services/runtime-service/rundownService.utils.ts +++ b/apps/server/src/services/runtime-service/rundownService.utils.ts @@ -5,8 +5,8 @@ import { timerConfig } from '../../setup/config.js'; /** * Checks whether we should update the clock value - * - clock has slid * - we have rolled into a new seconds unit + * this is different from the timer update as it looks at the clock as counting up */ export function getShouldClockUpdate(previousUpdate: number, now: number): boolean { const newSeconds = millisToSeconds(now, TimerType.CountUp) !== millisToSeconds(previousUpdate, TimerType.CountUp); @@ -18,10 +18,6 @@ export function getShouldClockUpdate(previousUpdate: number, now: number): boole * - we have rolled into a new seconds unit */ export function getShouldTimerUpdate(previousValue: MaybeNumber, currentValue: MaybeNumber): boolean { - if (currentValue === null) { - return false; - } - // we avoid trigger ahead since it can cause duplicate triggers const shouldUpdateTimer = millisToSeconds(currentValue) !== millisToSeconds(previousValue); return shouldUpdateTimer; }