mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
chore: rename currentBlock > parent
This commit is contained in:
@@ -56,7 +56,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -85,7 +85,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -114,7 +114,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -143,7 +143,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -172,7 +172,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -219,7 +219,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -248,7 +248,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -277,7 +277,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -306,7 +306,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -335,7 +335,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -382,7 +382,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -411,7 +411,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -440,7 +440,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
@@ -469,7 +469,7 @@ export const demoDb: DatabaseModel = {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: '',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
dayOffset: 0,
|
||||
|
||||
@@ -27,7 +27,7 @@ export const event: Omit<OntimeEvent, 'id' | 'cue'> = {
|
||||
timeDanger: 60000,
|
||||
custom: {},
|
||||
// !==== RUNTIME METADATA ====! //
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0, // calculated at runtime
|
||||
delay: 0, // calculated at runtime
|
||||
dayOffset: 0, // calculated at runtime
|
||||
|
||||
@@ -536,9 +536,9 @@ describe('generate() v4', () => {
|
||||
isFirstLinked: false,
|
||||
numEvents: 3,
|
||||
},
|
||||
'100': { type: SupportedEvent.Event, currentBlock: '1' },
|
||||
'200': { type: SupportedEvent.Event, currentBlock: '1' },
|
||||
'300': { type: SupportedEvent.Event, currentBlock: '1' },
|
||||
'100': { type: SupportedEvent.Event, parent: '1' },
|
||||
'200': { type: SupportedEvent.Event, parent: '1' },
|
||||
'300': { type: SupportedEvent.Event, parent: '1' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -567,7 +567,7 @@ describe('generate() v4', () => {
|
||||
expect(generatedRundown.totalDuration).toBe(1200);
|
||||
expect(generatedRundown.totalDelay).toBe(0);
|
||||
expect(generatedRundown.entries).toMatchObject({
|
||||
'0': { type: SupportedEvent.Event, currentBlock: null },
|
||||
'0': { type: SupportedEvent.Event, parent: null },
|
||||
'1': {
|
||||
type: SupportedEvent.Block,
|
||||
events: ['101', '102', '103'],
|
||||
@@ -577,9 +577,9 @@ describe('generate() v4', () => {
|
||||
isFirstLinked: false,
|
||||
numEvents: 3,
|
||||
},
|
||||
'101': { currentBlock: '1', gap: 90, linkStart: false },
|
||||
'102': { currentBlock: '1' },
|
||||
'103': { currentBlock: '1' },
|
||||
'101': { parent: '1', gap: 90, linkStart: false },
|
||||
'102': { parent: '1' },
|
||||
'103': { parent: '1' },
|
||||
'2': {
|
||||
type: SupportedEvent.Block,
|
||||
events: ['201', '202', '203'],
|
||||
|
||||
@@ -223,7 +223,7 @@ function processEntry<T extends OntimeEntry>(
|
||||
currentEntry.dayOffset = processedData.totalDays;
|
||||
currentEntry.delay = 0; // this means we dont calculate delays or gaps for skipped events
|
||||
currentEntry.gap = 0; // this means we dont calculate delays or gaps for skipped events
|
||||
currentEntry.currentBlock = childOfBlock;
|
||||
currentEntry.parent = childOfBlock;
|
||||
|
||||
// update rundown metadata, it only concerns playable events
|
||||
if (isPlayableEvent(currentEntry)) {
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
dayOffset: 0,
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
id: '1358',
|
||||
timeWarning: 0,
|
||||
@@ -85,7 +85,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
isPublic: false,
|
||||
skip: false,
|
||||
colour: 'red',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
@@ -136,7 +136,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: 'red',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
@@ -189,7 +189,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
dayOffset: 0,
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
id: '1358',
|
||||
timeWarning: 0,
|
||||
@@ -222,7 +222,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: 'red',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
@@ -259,7 +259,7 @@ describe('cellRequestFromEvent()', () => {
|
||||
isPublic: true,
|
||||
skip: false,
|
||||
colour: 'red',
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
revision: 0,
|
||||
delay: 0,
|
||||
gap: 0,
|
||||
|
||||
@@ -28,7 +28,7 @@ const mockEvent = {
|
||||
timeEnd: 1000,
|
||||
duration: 1000,
|
||||
skip: false,
|
||||
currentBlock: null,
|
||||
parent: null,
|
||||
} as PlayableEvent;
|
||||
|
||||
const mockState = {
|
||||
@@ -166,8 +166,8 @@ describe('mutation on runtimeState', () => {
|
||||
|
||||
// do this before the test so that it is applied
|
||||
const entries = {
|
||||
event1: { ...mockEvent, id: 'event1', timeStart: 0, timeEnd: 1000, duration: 1000, currentBlock: null },
|
||||
event2: { ...mockEvent, id: 'event2', timeStart: 1000, timeEnd: 1500, duration: 500, currentBlock: null },
|
||||
event1: { ...mockEvent, id: 'event1', timeStart: 0, timeEnd: 1000, duration: 1000, parent: null },
|
||||
event2: { ...mockEvent, id: 'event2', timeStart: 1000, timeEnd: 1500, duration: 500, parent: null },
|
||||
};
|
||||
const rundown = makeRundown({ entries, order: ['event1', 'event2'] });
|
||||
|
||||
@@ -346,11 +346,11 @@ describe('loadBlock', () => {
|
||||
test('from no-block to a block will clear startedAt', () => {
|
||||
const rundown = makeRundown({
|
||||
entries: {
|
||||
0: makeOntimeEvent({ id: '0', currentBlock: null }),
|
||||
0: makeOntimeEvent({ id: '0', parent: null }),
|
||||
1: makeOntimeBlock({ id: '1', events: ['11'] }),
|
||||
11: makeOntimeEvent({ id: '11', currentBlock: '1' }),
|
||||
11: makeOntimeEvent({ id: '11', parent: '1' }),
|
||||
2: makeOntimeBlock({ id: '2', events: [] }),
|
||||
3: makeOntimeEvent({ id: '3', currentBlock: null }),
|
||||
3: makeOntimeEvent({ id: '3', parent: null }),
|
||||
},
|
||||
order: ['0', '1', '2', '3'],
|
||||
});
|
||||
@@ -374,11 +374,11 @@ describe('loadBlock', () => {
|
||||
test('from block to a different block will clear startedAt', () => {
|
||||
const rundown = makeRundown({
|
||||
entries: {
|
||||
0: makeOntimeEvent({ id: '0', currentBlock: null }),
|
||||
0: makeOntimeEvent({ id: '0', parent: null }),
|
||||
1: makeOntimeBlock({ id: '1', events: ['11'] }),
|
||||
11: makeOntimeEvent({ id: '11', currentBlock: '1' }),
|
||||
11: makeOntimeEvent({ id: '11', parent: '1' }),
|
||||
2: makeOntimeBlock({ id: '2', events: ['22'] }),
|
||||
22: makeOntimeEvent({ id: '22', currentBlock: '2' }),
|
||||
22: makeOntimeEvent({ id: '22', parent: '2' }),
|
||||
},
|
||||
order: ['0', '1', '2'],
|
||||
});
|
||||
@@ -402,11 +402,11 @@ describe('loadBlock', () => {
|
||||
test('from block to a no-block will clear startedAt', () => {
|
||||
const rundown = makeRundown({
|
||||
entries: {
|
||||
0: makeOntimeEvent({ id: '0', currentBlock: null }),
|
||||
0: makeOntimeEvent({ id: '0', parent: null }),
|
||||
1: makeOntimeBlock({ id: '1', events: ['11'] }),
|
||||
11: makeOntimeEvent({ id: '11', currentBlock: '1' }),
|
||||
11: makeOntimeEvent({ id: '11', parent: '1' }),
|
||||
2: makeOntimeBlock({ id: '2', events: ['22'] }),
|
||||
22: makeOntimeEvent({ id: '22', currentBlock: '2' }),
|
||||
22: makeOntimeEvent({ id: '22', parent: '2' }),
|
||||
},
|
||||
order: ['0', '1', '2'],
|
||||
});
|
||||
@@ -431,8 +431,8 @@ describe('loadBlock', () => {
|
||||
const rundown = makeRundown({
|
||||
entries: {
|
||||
0: makeOntimeBlock({ id: '0', events: ['1', '2'] }),
|
||||
1: makeOntimeEvent({ id: '1', currentBlock: '0' }),
|
||||
2: makeOntimeEvent({ id: '2', currentBlock: '0' }),
|
||||
1: makeOntimeEvent({ id: '1', parent: '0' }),
|
||||
2: makeOntimeEvent({ id: '2', parent: '0' }),
|
||||
},
|
||||
order: ['0'],
|
||||
});
|
||||
@@ -456,8 +456,8 @@ describe('loadBlock', () => {
|
||||
test('from no-block to no-block will keep startedAt', () => {
|
||||
const rundown = makeRundown({
|
||||
entries: {
|
||||
0: makeOntimeEvent({ id: '0', currentBlock: null }),
|
||||
1: makeOntimeEvent({ id: '1', currentBlock: null }),
|
||||
0: makeOntimeEvent({ id: '0', parent: null }),
|
||||
1: makeOntimeEvent({ id: '1', parent: null }),
|
||||
},
|
||||
order: ['0', '1'],
|
||||
});
|
||||
|
||||
@@ -733,7 +733,7 @@ export function loadBlock(rundown: Rundown, state = runtimeState) {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentBlockId = state.eventNow.currentBlock;
|
||||
const currentBlockId = state.eventNow.parent;
|
||||
|
||||
// update time only if the block has changed
|
||||
if (state.currentBlock.block?.id != currentBlockId) {
|
||||
|
||||
@@ -424,7 +424,7 @@ export function createPatch(originalEvent: OntimeEvent, patchEvent: Partial<Onti
|
||||
gap: originalEvent.gap, // is regenerated if timer related data is changed
|
||||
// short circuit empty string
|
||||
cue: makeString(patchEvent.cue ?? null, originalEvent.cue),
|
||||
currentBlock: originalEvent.currentBlock,
|
||||
parent: originalEvent.parent,
|
||||
revision: originalEvent.revision,
|
||||
timeWarning: patchEvent.timeWarning ?? originalEvent.timeWarning,
|
||||
timeDanger: patchEvent.timeDanger ?? originalEvent.timeDanger,
|
||||
|
||||
Reference in New Issue
Block a user