Skip to content

Commit 1330f65

Browse files
committed
chore: improve logging in logAnyRemainingNowTimes
1 parent d908ac6 commit 1330f65

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
@@ -201,32 +201,31 @@ function preserveOrReplaceNowTimesInObjects(
201201
}
202202

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

214206
for (const obj of timelineObjs) {
215207
if (hasNow(obj.enable)) {
216-
ids.push(obj.id)
208+
badTimelineObjs.push(obj)
217209
}
218210

219211
for (const kf of obj.keyframes || []) {
220212
if (hasNow(kf.enable)) {
221-
ids.push(kf.id)
213+
badTimelineObjs.push(kf)
222214
}
223215
}
224216
}
225217

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

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

0 commit comments

Comments
 (0)