feat: progress view

This commit is contained in:
Carlos Valente
2024-06-21 15:10:38 +02:00
parent b7c48f38a9
commit 8aeb4c7a01
20 changed files with 736 additions and 1 deletions
+1
View File
@@ -8,6 +8,7 @@ export { sanitiseCue } from './src/cue-utils/cueUtils.js';
export { getCueCandidate } from './src/cue-utils/cueUtils.js';
export { generateId } from './src/generate-id/generateId.js';
export {
getByEventId,
getFirst,
getFirstEvent,
getFirstEventNormal,
@@ -3,6 +3,15 @@ import { isOntimeEvent } from 'ontime-types';
type IndexAndEntry = { entry: OntimeRundownEntry | null; index: number | null };
/**
* Gets an event with given if if it exists
* @param {OntimeRundownEntry[]} rundown
* @return {OntimeRundownEntry | null}
*/
export function getByEventId(rundown: OntimeRundownEntry[], eventId: string): OntimeRundownEntry | null {
return rundown.find((event) => event.id === eventId) ?? null;
}
/**
* Gets first event in rundown, if it exists
* @param {OntimeRundownEntry[]} rundown