-
Notifications
You must be signed in to change notification settings - Fork 4
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
SOF-2013 - Add Property for Show Style Variant Change on Segments #246
Conversation
…ew show style variants
src/tv2-common/getSegment.ts
Outdated
@@ -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 |
There was a problem hiding this comment.
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'))
There was a problem hiding this comment.
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!
src/tv2-common/getSegment.ts
Outdated
@@ -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 |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 :-)
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