mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
fix: group expected end
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { isOntimeEvent, MaybeNumber, OntimeBlock, OntimeEvent, Rundown, TimerPhase } from 'ontime-types';
|
||||
import { calculateTimeUntilStart, dayInMs, isPlaybackActive } from 'ontime-utils';
|
||||
import { isOntimeEvent, MaybeNumber, OntimeBlock, Rundown, TimerPhase } from 'ontime-types';
|
||||
import { calculateTimeUntilStart, dayInMs, getLastEventNormal, isPlaybackActive } from 'ontime-utils';
|
||||
import type { RuntimeState } from '../stores/runtimeState.js';
|
||||
import { shouldCrashDev } from '../utils/development.js';
|
||||
|
||||
@@ -40,13 +40,15 @@ export function getExpectedBlockFinish(state: RuntimeState, rundown: Rundown): M
|
||||
isLinkedToLoaded = isLinkedToLoaded && entry.linkStart;
|
||||
}
|
||||
}
|
||||
const lastEntry = entries[orderInBlock.at(-1)!] as OntimeEvent;
|
||||
const { lastEvent } = getLastEventNormal(rundown.entries, orderInBlock);
|
||||
if (!lastEvent) return null;
|
||||
|
||||
const { offsetMode, offset, plannedStart, actualStart } = state.runtime;
|
||||
|
||||
const timeUntilLastEvent = calculateTimeUntilStart({
|
||||
timeStart: lastEntry.timeStart,
|
||||
dayOffset: lastEntry.dayOffset,
|
||||
delay: lastEntry.delay,
|
||||
timeStart: lastEvent.timeStart,
|
||||
dayOffset: lastEvent.dayOffset,
|
||||
delay: lastEvent.delay,
|
||||
currentDay: eventNow.dayOffset,
|
||||
totalGap,
|
||||
isLinkedToLoaded,
|
||||
@@ -57,7 +59,7 @@ export function getExpectedBlockFinish(state: RuntimeState, rundown: Rundown): M
|
||||
actualStart,
|
||||
});
|
||||
|
||||
return clock + timeUntilLastEvent + lastEntry.duration;
|
||||
return clock + timeUntilLastEvent + lastEvent.duration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -723,7 +723,7 @@ export function loadBlock(rundown: Rundown, state = runtimeState) {
|
||||
|
||||
//we went into a new block - and it is different from the one we might have come from
|
||||
if ((state.blockNow != null && state.blockNow.id != currentBlockId) || state.blockNow == null) {
|
||||
state.blockNow = { id: currentBlockId, startedAt: null, expectedEnd: null }; // the id is set here, the start time is set in other placed that handel starting events
|
||||
state.blockNow = { id: currentBlockId, startedAt: null, expectedEnd: null }; // the id is set here, the start time is set when starting events
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user