@@ -5,9 +5,8 @@ import { DBSegment } from '../../../lib/collections/Segments'
55import { DBRundown } from '../../../lib/collections/Rundowns'
66import { literal , protectString } from '../../../lib/lib'
77import { RundownTimingCalculator , RundownTimingContext } from '../rundownTiming'
8- import { IBlueprintPieceType , PlaylistTimingType } from '@sofie-automation/blueprints-integration'
8+ import { PlaylistTimingType } from '@sofie-automation/blueprints-integration'
99import { PartId , RundownId , SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
10- import { CalculateTimingsPiece } from '@sofie-automation/corelib/dist/playout/timings'
1110
1211const DEFAULT_DURATION = 0
1312const DEFAULT_NONZERO_DURATION = 4000
@@ -112,7 +111,6 @@ describe('rundown Timing Calculator', () => {
112111 undefined ,
113112 parts ,
114113 partInstancesMap ,
115- new Map ( ) ,
116114 segmentsMap ,
117115 DEFAULT_DURATION ,
118116 [ ]
@@ -175,7 +173,6 @@ describe('rundown Timing Calculator', () => {
175173 undefined ,
176174 parts ,
177175 partInstancesMap ,
178- new Map ( ) ,
179176 segmentsMap ,
180177 DEFAULT_DURATION ,
181178 [ ]
@@ -277,7 +274,6 @@ describe('rundown Timing Calculator', () => {
277274 undefined ,
278275 parts ,
279276 partInstancesMap ,
280- new Map ( ) ,
281277 segmentsMap ,
282278 DEFAULT_DURATION ,
283279 [ ]
@@ -381,7 +377,6 @@ describe('rundown Timing Calculator', () => {
381377 undefined ,
382378 parts ,
383379 partInstancesMap ,
384- new Map ( ) ,
385380 segmentsMap ,
386381 DEFAULT_DURATION ,
387382 [ ]
@@ -509,7 +504,6 @@ describe('rundown Timing Calculator', () => {
509504 undefined ,
510505 parts ,
511506 partInstancesMap ,
512- new Map ( ) ,
513507 segmentsMap ,
514508 DEFAULT_DURATION ,
515509 [ ]
@@ -612,7 +606,6 @@ describe('rundown Timing Calculator', () => {
612606 undefined ,
613607 parts ,
614608 partInstancesMap ,
615- new Map ( ) ,
616609 segmentsMap ,
617610 DEFAULT_NONZERO_DURATION ,
618611 [ ]
@@ -743,7 +736,6 @@ describe('rundown Timing Calculator', () => {
743736 undefined ,
744737 parts ,
745738 partInstancesMap ,
746- new Map ( ) ,
747739 segmentsMap ,
748740 DEFAULT_NONZERO_DURATION ,
749741 [ ]
@@ -868,7 +860,6 @@ describe('rundown Timing Calculator', () => {
868860 undefined ,
869861 parts ,
870862 partInstancesMap ,
871- new Map ( ) ,
872863 segmentsMap ,
873864 DEFAULT_DURATION ,
874865 [ ]
@@ -943,127 +934,6 @@ describe('rundown Timing Calculator', () => {
943934 )
944935 } )
945936
946- it ( 'Adds Piece preroll to Part durations' , ( ) => {
947- const timing = new RundownTimingCalculator ( )
948- const playlist : RundownPlaylist = makeMockPlaylist ( )
949- playlist . timing = {
950- type : 'forward-time' as any ,
951- expectedStart : 0 ,
952- expectedDuration : 40000 ,
953- }
954- const rundownId = 'rundown1'
955- const segmentId1 = 'segment1'
956- const segmentId2 = 'segment2'
957- const segmentsMap : Map < SegmentId , DBSegment > = new Map ( )
958- segmentsMap . set ( protectString < SegmentId > ( segmentId1 ) , makeMockSegment ( segmentId1 , 0 , rundownId ) )
959- segmentsMap . set ( protectString < SegmentId > ( segmentId2 ) , makeMockSegment ( segmentId2 , 0 , rundownId ) )
960- const parts : Part [ ] = [ ]
961- parts . push ( makeMockPart ( 'part1' , 0 , rundownId , segmentId1 , { expectedDuration : 1000 } ) )
962- parts . push ( makeMockPart ( 'part2' , 0 , rundownId , segmentId1 , { expectedDuration : 1000 } ) )
963- parts . push ( makeMockPart ( 'part3' , 0 , rundownId , segmentId2 , { expectedDuration : 1000 } ) )
964- parts . push ( makeMockPart ( 'part4' , 0 , rundownId , segmentId2 , { expectedDuration : 1000 } ) )
965- const piecesMap : Map < PartId , CalculateTimingsPiece [ ] > = new Map ( )
966- piecesMap . set ( protectString ( 'part1' ) , [
967- literal < CalculateTimingsPiece > ( {
968- enable : {
969- start : 0 ,
970- } ,
971- prerollDuration : 5000 ,
972- pieceType : IBlueprintPieceType . Normal ,
973- } ) ,
974- ] )
975- piecesMap . set ( protectString ( 'part2' ) , [
976- literal < CalculateTimingsPiece > ( {
977- enable : {
978- start : 0 ,
979- } ,
980- prerollDuration : 240 ,
981- pieceType : IBlueprintPieceType . Normal ,
982- } ) ,
983- ] )
984- const partInstancesMap : Map < PartId , PartInstance > = new Map ( )
985- const rundown = makeMockRundown ( rundownId , playlist )
986- const rundowns = [ rundown ]
987- const result = timing . updateDurations (
988- 0 ,
989- false ,
990- playlist ,
991- rundowns ,
992- undefined ,
993- parts ,
994- partInstancesMap ,
995- piecesMap ,
996- segmentsMap ,
997- DEFAULT_DURATION ,
998- [ ]
999- )
1000- expect ( result ) . toEqual (
1001- literal < RundownTimingContext > ( {
1002- isLowResolution : false ,
1003- asDisplayedPlaylistDuration : 9240 ,
1004- asPlayedPlaylistDuration : 9240 ,
1005- currentPartInstanceId : null ,
1006- currentPartWillAutoNext : false ,
1007- currentTime : 0 ,
1008- rundownExpectedDurations : {
1009- [ rundownId ] : 9240 ,
1010- } ,
1011- rundownAsPlayedDurations : {
1012- [ rundownId ] : 9240 ,
1013- } ,
1014- partCountdown : {
1015- part1 : 0 ,
1016- part2 : 6000 ,
1017- part3 : 7240 ,
1018- part4 : 8240 ,
1019- } ,
1020- partDisplayDurations : {
1021- part1 : 6000 ,
1022- part2 : 1240 ,
1023- part3 : 1000 ,
1024- part4 : 1000 ,
1025- } ,
1026- partDisplayStartsAt : {
1027- part1 : 0 ,
1028- part2 : 6000 ,
1029- part3 : 7240 ,
1030- part4 : 8240 ,
1031- } ,
1032- partDurations : {
1033- part1 : 6000 ,
1034- part2 : 1240 ,
1035- part3 : 1000 ,
1036- part4 : 1000 ,
1037- } ,
1038- partExpectedDurations : {
1039- part1 : 6000 ,
1040- part2 : 1240 ,
1041- part3 : 1000 ,
1042- part4 : 1000 ,
1043- } ,
1044- partPlayed : {
1045- part1 : 0 ,
1046- part2 : 0 ,
1047- part3 : 0 ,
1048- part4 : 0 ,
1049- } ,
1050- partStartsAt : {
1051- part1 : 0 ,
1052- part2 : 6000 ,
1053- part3 : 7240 ,
1054- part4 : 8240 ,
1055- } ,
1056- remainingPlaylistDuration : 9240 ,
1057- totalPlaylistDuration : 9240 ,
1058- breakIsLastRundown : undefined ,
1059- remainingTimeOnCurrentPart : undefined ,
1060- rundownsBeforeNextBreak : undefined ,
1061- segmentBudgetDurations : { } ,
1062- segmentStartedPlayback : { } ,
1063- } )
1064- )
1065- } )
1066-
1067937 it ( 'Back-time: Can find the next expectedStart rundown anchor when it is in a future segment' , ( ) => {
1068938 const timing = new RundownTimingCalculator ( )
1069939 const playlist : RundownPlaylist = makeMockPlaylist ( )
@@ -1140,7 +1010,6 @@ describe('rundown Timing Calculator', () => {
11401010 rundown ,
11411011 parts ,
11421012 partInstancesMap ,
1143- new Map ( ) ,
11441013 segmentsMap ,
11451014 DEFAULT_DURATION ,
11461015 [ ]
@@ -1289,7 +1158,6 @@ describe('rundown Timing Calculator', () => {
12891158 rundown ,
12901159 parts ,
12911160 partInstancesMap ,
1292- new Map ( ) ,
12931161 segmentsMap ,
12941162 DEFAULT_DURATION ,
12951163 [ ]
@@ -1444,7 +1312,6 @@ describe('rundown Timing Calculator', () => {
14441312 rundown ,
14451313 parts ,
14461314 partInstancesMap ,
1447- new Map ( ) ,
14481315 segmentsMap ,
14491316 DEFAULT_DURATION ,
14501317 [ ]
@@ -1593,7 +1460,6 @@ describe('rundown Timing Calculator', () => {
15931460 rundown ,
15941461 parts ,
15951462 partInstancesMap ,
1596- new Map ( ) ,
15971463 segmentsMap ,
15981464 DEFAULT_DURATION ,
15991465 [ ]
@@ -1742,7 +1608,6 @@ describe('rundown Timing Calculator', () => {
17421608 rundown ,
17431609 parts ,
17441610 partInstancesMap ,
1745- new Map ( ) ,
17461611 segmentsMap ,
17471612 DEFAULT_DURATION ,
17481613 [ ]
@@ -1897,7 +1762,6 @@ describe('rundown Timing Calculator', () => {
18971762 rundown ,
18981763 parts ,
18991764 partInstancesMap ,
1900- new Map ( ) ,
19011765 segmentsMap ,
19021766 DEFAULT_DURATION ,
19031767 [ ]
0 commit comments