mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
refactor: cap timer values
This commit is contained in:
committed by
Carlos Valente
parent
bb199128aa
commit
119e6caca3
@@ -1,16 +1,18 @@
|
||||
import { OntimeEvent, isKeyOfType, isOntimeEvent } from 'ontime-types';
|
||||
import { MILLIS_PER_SECOND } from 'ontime-utils';
|
||||
|
||||
import { DataProvider } from '../classes/data-provider/DataProvider.js';
|
||||
import { editEvent } from '../services/rundown-service/RundownService.js';
|
||||
import { getEventWithId } from '../services/rundown-service/rundownUtils.js';
|
||||
import { coerceBoolean, coerceColour, coerceNumber, coerceString } from '../utils/coerceType.js';
|
||||
import { maxDuration } from '../../../../packages/utils/src/date-utils/conversionUtils.js';
|
||||
|
||||
const whitelistedPayload = {
|
||||
title: coerceString,
|
||||
note: coerceString,
|
||||
cue: coerceString,
|
||||
|
||||
duration: (value: unknown) => coerceNumber(value) * 1000,
|
||||
duration: (value: unknown) => Math.max(coerceNumber(value) * MILLIS_PER_SECOND, maxDuration),
|
||||
|
||||
isPublic: coerceBoolean,
|
||||
skip: coerceBoolean,
|
||||
|
||||
Reference in New Issue
Block a user