Skip to content

Commit

Permalink
Merge pull request #246 from tv2/SOF-2013/addPropertyForShowStyleChan…
Browse files Browse the repository at this point in the history
…geOnSegment

SOF-2013 - Add Property for Show Style Variant Change on Segments
  • Loading branch information
RasmusAlbrektsen authored Jun 17, 2024
2 parents 1d15e14 + 26f3ceb commit 7b59648
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 7b59648

Please sign in to comment.