@@ -58,12 +58,11 @@ export async function updateRundownFromIngestData(
5858 {
5959 name : 'selectShowStyleVariant' ,
6060 identifier : `studioId=${ context . studio . _id } ,rundownId=${ ingestModel . rundownId } ,ingestRundownId=${ ingestModel . rundownExternalId } ` ,
61- tempSendUserNotesIntoBlackHole : true ,
6261 } ,
6362 context . studio ,
6463 context . getStudioBlueprintConfig ( )
6564 )
66- // TODO-CONTEXT save any user notes from selectShowStyleContext
65+
6766 const showStyle = await selectShowStyleVariant (
6867 context ,
6968 selectShowStyleContext ,
@@ -80,6 +79,14 @@ export async function updateRundownFromIngestData(
8079 const showStyleBlueprint = await context . getShowStyleBlueprint ( showStyle . base . _id )
8180 const allRundownWatchedPackages = await pAllRundownWatchedPackages
8281
82+ const extraRundownNotes : RundownNote [ ] = selectShowStyleContext . notes . map ( ( note ) => ( {
83+ type : note . type ,
84+ message : wrapTranslatableMessageFromBlueprints ( note . message , [ showStyleBlueprint . blueprintId ] ) ,
85+ origin : {
86+ name : 'selectShowStyleVariant' ,
87+ } ,
88+ } ) )
89+
8390 // Call blueprints, get rundown
8491 const dbRundown = await regenerateRundownAndBaselineFromIngestData (
8592 context ,
@@ -88,7 +95,8 @@ export async function updateRundownFromIngestData(
8895 rundownSource ,
8996 showStyle ,
9097 showStyleBlueprint ,
91- allRundownWatchedPackages
98+ allRundownWatchedPackages ,
99+ extraRundownNotes
92100 )
93101 if ( ! dbRundown ) {
94102 // We got no rundown, abort:
@@ -147,13 +155,11 @@ export async function updateRundownMetadataFromIngestData(
147155 {
148156 name : 'selectShowStyleVariant' ,
149157 identifier : `studioId=${ context . studio . _id } ,rundownId=${ ingestModel . rundownId } ,ingestRundownId=${ ingestModel . rundownExternalId } ` ,
150- tempSendUserNotesIntoBlackHole : true ,
151158 } ,
152159 context . studio ,
153160 context . getStudioBlueprintConfig ( )
154161 )
155162
156- // TODO-CONTEXT save any user notes from selectShowStyleContext
157163 const showStyle = await selectShowStyleVariant (
158164 context ,
159165 selectShowStyleContext ,
@@ -170,6 +176,14 @@ export async function updateRundownMetadataFromIngestData(
170176 const showStyleBlueprint = await context . getShowStyleBlueprint ( showStyle . base . _id )
171177 const allRundownWatchedPackages = await pAllRundownWatchedPackages
172178
179+ const extraRundownNotes : RundownNote [ ] = selectShowStyleContext . notes . map ( ( note ) => ( {
180+ type : note . type ,
181+ message : wrapTranslatableMessageFromBlueprints ( note . message , [ showStyleBlueprint . blueprintId ] ) ,
182+ origin : {
183+ name : 'selectShowStyleVariant' ,
184+ } ,
185+ } ) )
186+
173187 // Call blueprints, get rundown
174188 const dbRundown = await regenerateRundownAndBaselineFromIngestData (
175189 context ,
@@ -178,7 +192,8 @@ export async function updateRundownMetadataFromIngestData(
178192 rundownSource ,
179193 showStyle ,
180194 showStyleBlueprint ,
181- allRundownWatchedPackages
195+ allRundownWatchedPackages ,
196+ extraRundownNotes
182197 )
183198 if ( ! dbRundown ) {
184199 // We got no rundown, abort:
@@ -225,6 +240,7 @@ export async function updateRundownMetadataFromIngestData(
225240 * @param showStyle ShowStyle to regenerate for
226241 * @param showStyleBlueprint ShowStyle Blueprint to regenerate with
227242 * @param allRundownWatchedPackages WatchedPackagesHelper for all packages belonging to the rundown
243+ * @param extraRundownNotes Additional notes to add to the Rundown, produced earlier in the ingest process
228244 * @returns Generated documents or null if Blueprints reject the Rundown
229245 */
230246export async function regenerateRundownAndBaselineFromIngestData (
@@ -234,7 +250,8 @@ export async function regenerateRundownAndBaselineFromIngestData(
234250 rundownSource : RundownSource ,
235251 showStyle : SelectedShowStyleVariant ,
236252 showStyleBlueprint : ReadonlyDeep < WrappedShowStyleBlueprint > ,
237- allRundownWatchedPackages : WatchedPackagesHelper
253+ allRundownWatchedPackages : WatchedPackagesHelper ,
254+ extraRundownNotes : RundownNote [ ]
238255) : Promise < ReadonlyDeep < DBRundown > | null > {
239256 const rundownBaselinePackages = allRundownWatchedPackages . filter (
240257 context ,
@@ -297,15 +314,17 @@ export async function regenerateRundownAndBaselineFromIngestData(
297314 }
298315
299316 // Ensure the ids in the notes are clean
300- const rundownNotes = blueprintContext . notes . map ( ( note ) =>
301- literal < RundownNote > ( {
302- type : note . type ,
303- message : wrapTranslatableMessageFromBlueprints ( note . message , translationNamespaces ) ,
304- origin : {
305- name : `${ showStyle . base . name } -${ showStyle . variant . name } ` ,
306- } ,
307- } )
308- )
317+ const rundownNotes = blueprintContext . notes
318+ . map ( ( note ) =>
319+ literal < RundownNote > ( {
320+ type : note . type ,
321+ message : wrapTranslatableMessageFromBlueprints ( note . message , translationNamespaces ) ,
322+ origin : {
323+ name : `${ showStyle . base . name } -${ showStyle . variant . name } ` ,
324+ } ,
325+ } )
326+ )
327+ . concat ( extraRundownNotes )
309328
310329 ingestModel . setRundownData (
311330 rundownRes . rundown ,
0 commit comments