@@ -37,7 +37,6 @@ import { deserializePieceTimelineObjectsBlob } from '@sofie-automation/corelib/d
3737import { convertResolvedPieceInstanceToBlueprints } from '../../blueprints/context/lib.js'
3838import { buildTimelineObjsForRundown , RundownTimelineTimingContext } from './rundown.js'
3939import { SourceLayers } from '@sofie-automation/corelib/dist/dataModel/ShowStyleBase'
40- import { deNowifyMultiGatewayTimeline } from './multi-gateway.js'
4140import { validateTimeline } from 'superfly-timeline'
4241import { getPartTimingsOrDefaults , PartCalculatedTimings } from '@sofie-automation/corelib/dist/playout/timings'
4342import { applyAbPlaybackForTimeline } from '../abPlayback/index.js'
@@ -140,39 +139,21 @@ export async function updateStudioTimeline(
140139
141140export async function updateTimeline ( context : JobContext , playoutModel : PlayoutModel ) : Promise < void > {
142141 const span = context . startSpan ( 'updateTimeline' )
143- logger . debug ( 'updateTimeline running... ' )
142+ logger . debug ( 'updateTimeline: marking playlist as needing timeline update ' )
144143
145144 if ( ! playoutModel . playlist . activationId ) {
146145 throw new Error ( `RundownPlaylist ("${ playoutModel . playlist . _id } ") is not active")` )
147146 }
148147
149- const {
150- versions,
151- objs : timelineObjs ,
152- timingContext : timingInfo ,
153- regenerateTimelineToken,
154- } = await getTimelineRundown ( context , playoutModel )
155-
156- flattenAndProcessTimelineObjects ( context , timelineObjs )
157-
158- preserveOrReplaceNowTimesInObjects ( playoutModel , timelineObjs )
159-
160- if ( playoutModel . isMultiGatewayMode ) {
161- deNowifyMultiGatewayTimeline ( playoutModel , timelineObjs , timingInfo )
162-
163- logAnyRemainingNowTimes ( context , timelineObjs )
164- }
165-
166- const timelineHash = playoutModel . setTimeline ( timelineObjs , versions , regenerateTimelineToken ) . timelineHash
167- logger . verbose ( `updateTimeline done, hash: "${ timelineHash } "` )
148+ playoutModel . markTimelineNeedsUpdate ( )
168149
169150 if ( span ) span . end ( )
170151}
171152
172- function preserveOrReplaceNowTimesInObjects (
153+ export function preserveOrReplaceNowTimesInObjects (
173154 studioPlayoutModel : StudioPlayoutModelBase ,
174155 timelineObjs : Array < TimelineObjGeneric >
175- ) {
156+ ) : void {
176157 const timeline = studioPlayoutModel . timeline
177158 const oldTimelineObjsMap = normalizeArray (
178159 ( timeline ?. timelineBlob !== undefined && deserializeTimelineBlob ( timeline . timelineBlob ) ) || [ ] ,
@@ -202,7 +183,7 @@ function preserveOrReplaceNowTimesInObjects(
202183 } )
203184}
204185
205- function logAnyRemainingNowTimes ( _context : JobContext , timelineObjs : Array < TimelineObjGeneric > ) : void {
186+ export function logAnyRemainingNowTimes ( _context : JobContext , timelineObjs : Array < TimelineObjGeneric > ) : void {
206187 const badTimelineObjs : any [ ] = [ ]
207188
208189 for ( const obj of timelineObjs ) {
@@ -287,7 +268,7 @@ function getPartInstanceTimelineInfo(
287268/**
288269 * Returns timeline objects related to rundowns in a studio
289270 */
290- async function getTimelineRundown (
271+ export async function getTimelineRundown (
291272 context : JobContext ,
292273 playoutModel : PlayoutModel
293274) : Promise < {
@@ -541,7 +522,7 @@ function createRegenerateTimelineObj(
541522 * @param context
542523 * @param timelineObjs Array of timeline objects
543524 */
544- function flattenAndProcessTimelineObjects ( context : JobContext , timelineObjs : Array < TimelineObjGeneric > ) : void {
525+ export function flattenAndProcessTimelineObjects ( context : JobContext , timelineObjs : Array < TimelineObjGeneric > ) : void {
545526 const span = context . startSpan ( 'processTimelineObjects' )
546527
547528 // first, split out any grouped objects, to make the timeline shallow:
0 commit comments