Allow time change from api (#1009)

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
Alex Christoffer Rasmussen
2024-06-02 15:21:09 +02:00
committed by GitHub
parent d8626ff324
commit 3895b37572
6 changed files with 88 additions and 14 deletions
@@ -100,7 +100,7 @@ export function handleCustomField(
}
/** List of event properties which do not need the rundown to be regenerated */
enum regenerateWhitelist {
export enum regenerateWhitelist {
'id',
'cue',
'title',
@@ -122,6 +122,14 @@ export function isDataStale(patch: Partial<OntimeRundownEntry>): boolean {
return Object.keys(patch).some((key) => !(key in regenerateWhitelist));
}
/**
* given a key, returns whether it is whitelisted
* @param path
*/
export function willCauseRegeneration(key: keyof OntimeEvent): boolean {
return !(key in regenerateWhitelist);
}
/**
* Given an event and a patch to that event checks whether there are actual changes to the dataset
* @param existingEvent