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

Conversation

RasmusAlbrektsen
Copy link

@RasmusAlbrektsen RasmusAlbrektsen commented Jun 13, 2024

This PR introduces a property on segments that will tell us whether or not a new show style variant is defined by the segment. This is to be used in Sofie Server so we can reingest based on the property.

This is used in the Sofie Server PR: https://github.com/tv2/sofie-server/pull/169

@@ -125,6 +126,10 @@ export async function getSegmentBase<ShowStyleConfig extends TV2ShowStyleConfig>
segment.isHidden = false
}

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

Choose a reason for hiding this comment

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

Depending on the linting setup, you can use optional chaining instead and disregard the false literal:

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

Copy link
Author

Choose a reason for hiding this comment

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

Changed to use optional chaining!

@@ -125,6 +126,10 @@ export async function getSegmentBase<ShowStyleConfig extends TV2ShowStyleConfig>
segment.isHidden = false
}

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

Choose a reason for hiding this comment

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

On the offchance that someone accidentally didn't place the showstyleVariant keyword on line one of the cue, maybe we should check all lines of the cue?

Also, the cue is Sofie=Showstylevariant, not just showstyleVariant. And it would be nice with a constant instead of a magic string :)

Copy link
Author

Choose a reason for hiding this comment

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

It now checks all cues and uses a constant instead :-)

@RasmusAlbrektsen RasmusAlbrektsen merged commit 7b59648 into staging Jun 17, 2024
5 checks passed
@RasmusAlbrektsen RasmusAlbrektsen deleted the SOF-2013/addPropertyForShowStyleChangeOnSegment branch June 17, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants