Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/blueprints-integration/src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export interface IBlueprintActionManifest<TPrivateData = unknown, TPublicData =
*/
partId?: string

/** When something bad has happened, we can mark the action as invalid, which will prevent the user from executing it */
invalid?: boolean

/**
* Set to true if ad-lib action should can be used in any showstyle-variant. Default: false = only used by the current variant.
* This is useful for actions in Buckets, so that they can be easily shared between rundowns.
Expand Down
1 change: 1 addition & 0 deletions packages/job-worker/src/blueprints/context/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export function convertAdLibActionToBlueprints(action: ReadonlyDeep<AdLibAction>
privateData: clone(action.privateData),
publicData: clone(action.publicData),
partId: unprotectString(action.partId),
invalid: action.invalid,
allVariants: action.allVariants,
userDataManifest: clone(action.userDataManifest),
display: clone<IBlueprintActionManifestDisplay | IBlueprintActionManifestDisplayContent>(action.display), // TODO - type mismatch
Expand Down
6 changes: 6 additions & 0 deletions packages/job-worker/src/playout/adlibAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export async function executeAdlibActionAndSaveModel(
])
const adLibActionDoc = adLibAction ?? baselineAdLibAction ?? bucketAdLibAction

if (adLibActionDoc && adLibActionDoc.invalid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain in what cases adLibActionDoc.invalid will be truthy? It is not included in any of the projections above

throw UserError.from(
new Error(`Cannot take invalid AdLib Action "${adLibActionDoc._id}"!`),
UserErrorMessage.AdlibUnplayable
)

let watchedPackages = WatchedPackagesHelper.empty(context)
if (adLibActionDoc && 'rundownId' in adLibActionDoc) {
watchedPackages = await WatchedPackagesHelper.create(context, adLibActionDoc.rundownId, null, {
Expand Down
1 change: 1 addition & 0 deletions packages/webui/src/client/ui/Shelf/AdLibPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ function actionToAdLibPieceUi(
uniquenessId: action.display.uniquenessId,
lifespan: PieceLifespan.WithinPart, // value doesn't matter
expectedPackages: action.expectedPackages,
invalid: action.invalid,
})
}

Expand Down
Loading