@@ -35,6 +35,9 @@ import type { INoteBase } from '@sofie-automation/corelib/dist/dataModel/Notes'
3535import { NotificationsModelHelper } from '../notifications/NotificationsModelHelper.js'
3636import type { INotificationsModel } from '../notifications/NotificationsModel.js'
3737import { PersistentPlayoutStateStore } from '../blueprints/context/services/PersistantStateStore.js'
38+ import { AdLibAction } from '@sofie-automation/corelib/dist/dataModel/AdlibAction'
39+ import { RundownBaselineAdLibAction } from '@sofie-automation/corelib/dist/dataModel/RundownBaselineAdLibAction'
40+ import { BucketAdLibAction } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibAction'
3841
3942/**
4043 * Execute an AdLib Action
@@ -78,17 +81,39 @@ export async function executeAdlibActionAndSaveModel(
7881
7982 const [ adLibAction , baselineAdLibAction , bucketAdLibAction ] = await Promise . all ( [
8083 context . directCollections . AdLibActions . findOne ( data . actionDocId as AdLibActionId , {
81- projection : { _id : 1 , privateData : 1 } ,
82- } ) ,
84+ projection : {
85+ _id : 1 ,
86+ privateData : 1 ,
87+ publicData : 1 ,
88+ invalid : 1 ,
89+ rundownId : 1 ,
90+ } ,
91+ } ) as Promise < Pick < AdLibAction , '_id' | 'privateData' | 'publicData' | 'invalid' | 'rundownId' > | undefined > ,
8392 context . directCollections . RundownBaselineAdLibActions . findOne (
8493 data . actionDocId as RundownBaselineAdLibActionId ,
8594 {
86- projection : { _id : 1 , privateData : 1 } ,
95+ projection : {
96+ _id : 1 ,
97+ privateData : 1 ,
98+ publicData : 1 ,
99+ invalid : 1 ,
100+ rundownId : 1 ,
101+ } ,
87102 }
88- ) ,
103+ ) as Promise <
104+ Pick < RundownBaselineAdLibAction , '_id' | 'privateData' | 'publicData' | 'invalid' | 'rundownId' > | undefined
105+ > ,
89106 context . directCollections . BucketAdLibActions . findOne ( data . actionDocId as BucketAdLibActionId , {
90- projection : { _id : 1 , privateData : 1 } ,
91- } ) ,
107+ projection : {
108+ _id : 1 ,
109+ privateData : 1 ,
110+ publicData : 1 ,
111+ invalid : 1 ,
112+ bucketId : 1 ,
113+ } ,
114+ } ) as Promise <
115+ Pick < BucketAdLibAction , '_id' | 'privateData' | 'publicData' | 'invalid' | 'bucketId' > | undefined
116+ > ,
92117 ] )
93118 const adLibActionDoc = adLibAction ?? baselineAdLibAction ?? bucketAdLibAction
94119
0 commit comments