Skip to content

Commit 7895349

Browse files
committed
chore: improve logging in logAnyRemainingNowTimes
1 parent 663e570 commit 7895349

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

packages/job-worker/src/playout/timeline/generate.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -202,32 +202,31 @@ function preserveOrReplaceNowTimesInObjects(
202202
}
203203

204204
function logAnyRemainingNowTimes(_context: JobContext, timelineObjs: Array<TimelineObjGeneric>): void {
205-
const ids: string[] = []
206-
207-
const hasNow = (obj: TimelineEnableExt | TimelineEnableExt[]) => {
208-
let res = false
209-
applyToArray(obj, (enable) => {
210-
if (enable.start === 'now' || enable.end === 'now') res = true
211-
})
212-
return res
213-
}
205+
const badTimelineObjs: any[] = []
214206

215207
for (const obj of timelineObjs) {
216208
if (hasNow(obj.enable)) {
217-
ids.push(obj.id)
209+
badTimelineObjs.push(obj)
218210
}
219211

220212
for (const kf of obj.keyframes || []) {
221213
if (hasNow(kf.enable)) {
222-
ids.push(kf.id)
214+
badTimelineObjs.push(kf)
223215
}
224216
}
225217
}
226218

227-
if (ids.length) {
228-
logger.error(`Some timeline objects have unexpected now times!: ${JSON.stringify(ids)}`)
219+
if (badTimelineObjs.length) {
220+
logger.error(`Some timeline objects have unexpected now times!: ${JSON.stringify(badTimelineObjs)}`)
229221
}
230222
}
223+
function hasNow(obj: TimelineEnableExt | TimelineEnableExt[]) {
224+
let res = false
225+
applyToArray(obj, (enable) => {
226+
if (enable.start === 'now' || enable.end === 'now') res = true
227+
})
228+
return res
229+
}
231230

232231
/** Store the timelineobjects into the model, and perform any post-save actions */
233232
export function saveTimeline(

0 commit comments

Comments
 (0)