Skip to content

Commit

Permalink
fix: Checks all cues for variants and uses constant for magic string
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusAlbrektsen committed Jun 14, 2024
1 parent 28560cc commit 26f3ceb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tv2-common/getSegment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,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 @@ -127,7 +129,7 @@ export async function getSegmentBase<ShowStyleConfig extends TV2ShowStyleConfig>
}

segment.definesShowStyleVariant = iNewsStory.cues.some((cue) =>
cue ? cue[0].toLowerCase().includes('showstylevariant') : false
cue?.some((cueElement) => cueElement.toLowerCase().includes(SHOW_STYLE_VARIANT_LOWER_CASE_CUE))
)

const totalTimeMs = TimeFromINewsField(iNewsStory.fields.totalTime) * 1000
Expand Down

0 comments on commit 26f3ceb

Please sign in to comment.