Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOF-2013 - Add Property for Show Style Variant Change on Segments #246

Merged
Merged
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
7 changes: 7 additions & 0 deletions src/tv2-common/getSegment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface GetSegmentShowstyleOptions<ShowStyleConfig extends TV2ShowStyle

interface Segment<T> extends IBlueprintSegment<T> {
invalidity?: SegmentInvalidity
definesShowStyleVariant?: boolean
}

interface SegmentInvalidity {
Expand All @@ -96,6 +97,8 @@ interface SegmentMetadata {
miniShelfVideoClipFile?: string
}

const SHOW_STYLE_VARIANT_LOWER_CASE_CUE: string = 'sofie=showstylevariant'

export async function getSegmentBase<ShowStyleConfig extends TV2ShowStyleConfig>(
context: SegmentContext<ShowStyleConfig>,
ingestSegment: IngestSegment,
Expand Down Expand Up @@ -125,6 +128,10 @@ export async function getSegmentBase<ShowStyleConfig extends TV2ShowStyleConfig>
segment.isHidden = false
}

segment.definesShowStyleVariant = iNewsStory.cues.some((cue) =>
cue?.some((cueElement) => cueElement.toLowerCase().includes(SHOW_STYLE_VARIANT_LOWER_CASE_CUE))
)

const totalTimeMs = TimeFromINewsField(iNewsStory.fields.totalTime) * 1000
let blueprintParts: BlueprintResultPart[] = []
const parsedParts: PartDefinition[] = ParseBody(
Expand Down
Loading