mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-08 15:59:16 +00:00
Fix multiday (#1850)
* chore: cleanup typeings * fix: total gap should only accumulate after the curent loaded * fix: add the current day of the event to start day offset
This commit is contained in:
committed by
GitHub
parent
897210d5e3
commit
b7e5723fb2
@@ -140,7 +140,7 @@ describe('initRundownMetadata()', () => {
|
|||||||
eventIndex: 2,
|
eventIndex: 2,
|
||||||
isPast: true,
|
isPast: true,
|
||||||
isNextDay: false,
|
isNextDay: false,
|
||||||
totalGap: 10,
|
totalGap: 0,
|
||||||
isLinkedToLoaded: false,
|
isLinkedToLoaded: false,
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
groupId: 'group',
|
groupId: 'group',
|
||||||
@@ -156,7 +156,7 @@ describe('initRundownMetadata()', () => {
|
|||||||
eventIndex: 2,
|
eventIndex: 2,
|
||||||
isPast: true,
|
isPast: true,
|
||||||
isNextDay: false,
|
isNextDay: false,
|
||||||
totalGap: 10,
|
totalGap: 0,
|
||||||
isLinkedToLoaded: false,
|
isLinkedToLoaded: false,
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
groupId: 'group',
|
groupId: 'group',
|
||||||
@@ -172,7 +172,7 @@ describe('initRundownMetadata()', () => {
|
|||||||
eventIndex: 3,
|
eventIndex: 3,
|
||||||
isPast: false,
|
isPast: false,
|
||||||
isNextDay: false,
|
isNextDay: false,
|
||||||
totalGap: 10,
|
totalGap: 0,
|
||||||
isLinkedToLoaded: true,
|
isLinkedToLoaded: true,
|
||||||
isLoaded: true,
|
isLoaded: true,
|
||||||
groupId: 'group',
|
groupId: 'group',
|
||||||
@@ -188,7 +188,7 @@ describe('initRundownMetadata()', () => {
|
|||||||
eventIndex: 4,
|
eventIndex: 4,
|
||||||
isPast: false,
|
isPast: false,
|
||||||
isNextDay: false,
|
isNextDay: false,
|
||||||
totalGap: 10,
|
totalGap: 0,
|
||||||
isLinkedToLoaded: true,
|
isLinkedToLoaded: true,
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
groupId: 'group',
|
groupId: 'group',
|
||||||
@@ -204,7 +204,7 @@ describe('initRundownMetadata()', () => {
|
|||||||
eventIndex: 5,
|
eventIndex: 5,
|
||||||
isPast: false,
|
isPast: false,
|
||||||
isNextDay: false,
|
isNextDay: false,
|
||||||
totalGap: 17,
|
totalGap: 7,
|
||||||
isLinkedToLoaded: false,
|
isLinkedToLoaded: false,
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
groupId: null,
|
groupId: null,
|
||||||
|
|||||||
@@ -151,14 +151,14 @@ function processEntry(
|
|||||||
|
|
||||||
if (isPlayableEvent(entry)) {
|
if (isPlayableEvent(entry)) {
|
||||||
processedData.isNextDay = checkIsNextDay(entry, processedData.previousEvent);
|
processedData.isNextDay = checkIsNextDay(entry, processedData.previousEvent);
|
||||||
processedData.totalGap += entry.gap;
|
|
||||||
|
|
||||||
if (!processedData.isPast && !processedData.isLoaded) {
|
if (!processedData.isPast && !processedData.isLoaded) {
|
||||||
/**
|
/**
|
||||||
* isLinkToLoaded is a chain value that we maintain until we
|
* isLinkToLoaded is a chain value that we maintain until we
|
||||||
* a) find an unlinked event
|
* a) find an unlinked event
|
||||||
* b) find a countToEnd event
|
* b) find a countToEnd event
|
||||||
*/
|
*/
|
||||||
|
processedData.totalGap += entry.gap;
|
||||||
processedData.isLinkedToLoaded =
|
processedData.isLinkedToLoaded =
|
||||||
entry.linkStart && !processedData.previousEvent?.countToEnd && processedData.isLinkedToLoaded;
|
entry.linkStart && !processedData.previousEvent?.countToEnd && processedData.isLinkedToLoaded;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useNavigate } from 'react-router';
|
|||||||
import { EntryId, PlayableEvent } from 'ontime-types';
|
import { EntryId, PlayableEvent } from 'ontime-types';
|
||||||
|
|
||||||
import Button from '../../common/components/buttons/Button';
|
import Button from '../../common/components/buttons/Button';
|
||||||
|
import { ExtendedEntry } from '../../common/utils/rundownMetadata';
|
||||||
import { cx } from '../../common/utils/styleUtils';
|
import { cx } from '../../common/utils/styleUtils';
|
||||||
import ClockTime from '../../features/viewers/common/clock-time/ClockTime';
|
import ClockTime from '../../features/viewers/common/clock-time/ClockTime';
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ import { makeSubscriptionsUrl } from './countdown.utils';
|
|||||||
import './Countdown.scss';
|
import './Countdown.scss';
|
||||||
|
|
||||||
interface CountdownSelectProps {
|
interface CountdownSelectProps {
|
||||||
events: PlayableEvent[];
|
events: ExtendedEntry<PlayableEvent>[];
|
||||||
subscriptions: EntryId[];
|
subscriptions: EntryId[];
|
||||||
disableEdit: () => void;
|
disableEdit: () => void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ export function start(state: RuntimeState = runtimeState): boolean {
|
|||||||
state.timer.elapsed = 0;
|
state.timer.elapsed = 0;
|
||||||
|
|
||||||
if (state.rundown.actualStart === null) {
|
if (state.rundown.actualStart === null) {
|
||||||
state._startDayOffset = findDayOffset(state.eventNow.timeStart, state.clock);
|
state._startDayOffset = findDayOffset(state.eventNow.timeStart, state.clock) + state.eventNow.dayOffset;
|
||||||
state.rundown.currentDay = state._startDayOffset;
|
state.rundown.currentDay = state._startDayOffset;
|
||||||
state._startEpoch = epoch;
|
state._startEpoch = epoch;
|
||||||
state.rundown.actualStart = state.clock;
|
state.rundown.actualStart = state.clock;
|
||||||
|
|||||||
Reference in New Issue
Block a user