Skip to content

Commit

Permalink
SOF-1979 Parts that have zero Pieces does not count for making a Segm…
Browse files Browse the repository at this point in the history
…ent invalid
  • Loading branch information
LindvedKrvang committed May 14, 2024
1 parent 7f9fe5b commit edd41b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tv2-common/getSegment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ function getSegmentInvalidity(
parts: BlueprintResultPart[]
): SegmentInvalidity | undefined {
const doesSegmentHaveMiniShelf: boolean = !!segment.metaData?.miniShelfVideoClipFile
if (doesSegmentHaveMiniShelf && parts.length > 0) {
const doesSegmentHaveValidParts: boolean = parts.length > 0 && parts.some((part) => part.pieces.length > 0)
if (doesSegmentHaveMiniShelf && doesSegmentHaveValidParts) {
return {
reason: 'MiniShelf Segments are not allowed to also have Parts.'
}
Expand Down

0 comments on commit edd41b8

Please sign in to comment.