@@ -9,9 +9,8 @@ import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
99import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
1010import { literal , protectString , unprotectString } from '../tempLib'
1111import { RundownTimingCalculator , RundownTimingContext , findPartInstancesInQuickLoop } from '../rundownTiming'
12- import { IBlueprintPieceType , PlaylistTimingType , SegmentTimingInfo } from '@sofie-automation/blueprints-integration'
12+ import { PlaylistTimingType , SegmentTimingInfo } from '@sofie-automation/blueprints-integration'
1313import { PartId , RundownId , SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
14- import { CalculateTimingsPiece } from '@sofie-automation/corelib/dist/playout/timings'
1514
1615const DEFAULT_DURATION = 0
1716const DEFAULT_NONZERO_DURATION = 4000
@@ -1262,126 +1261,6 @@ describe('rundown Timing Calculator', () => {
12621261 )
12631262 } )
12641263
1265- it ( 'Adds Piece preroll to Part durations' , ( ) => {
1266- const timing = new RundownTimingCalculator ( )
1267- const playlist : DBRundownPlaylist = makeMockPlaylist ( )
1268- playlist . timing = {
1269- type : 'forward-time' as any ,
1270- expectedStart : 0 ,
1271- expectedDuration : 40000 ,
1272- }
1273- const rundownId = 'rundown1'
1274- const segmentId1 = 'segment1'
1275- const segmentId2 = 'segment2'
1276- const segmentsMap : Map < SegmentId , DBSegment > = new Map ( )
1277- segmentsMap . set ( protectString < SegmentId > ( segmentId1 ) , makeMockSegment ( segmentId1 , 0 , rundownId ) )
1278- segmentsMap . set ( protectString < SegmentId > ( segmentId2 ) , makeMockSegment ( segmentId2 , 0 , rundownId ) )
1279- const parts : DBPart [ ] = [ ]
1280- parts . push ( makeMockPart ( 'part1' , 0 , rundownId , segmentId1 , { expectedDuration : 1000 } ) )
1281- parts . push ( makeMockPart ( 'part2' , 0 , rundownId , segmentId1 , { expectedDuration : 1000 } ) )
1282- parts . push ( makeMockPart ( 'part3' , 0 , rundownId , segmentId2 , { expectedDuration : 1000 } ) )
1283- parts . push ( makeMockPart ( 'part4' , 0 , rundownId , segmentId2 , { expectedDuration : 1000 } ) )
1284- const partInstances = convertPartsToPartInstances ( parts )
1285- const piecesMap : Map < PartId , CalculateTimingsPiece [ ] > = new Map ( )
1286- piecesMap . set ( protectString ( 'part1' ) , [
1287- literal < CalculateTimingsPiece > ( {
1288- enable : {
1289- start : 0 ,
1290- } ,
1291- prerollDuration : 5000 ,
1292- pieceType : IBlueprintPieceType . Normal ,
1293- } ) ,
1294- ] )
1295- piecesMap . set ( protectString ( 'part2' ) , [
1296- literal < CalculateTimingsPiece > ( {
1297- enable : {
1298- start : 0 ,
1299- } ,
1300- prerollDuration : 240 ,
1301- pieceType : IBlueprintPieceType . Normal ,
1302- } ) ,
1303- ] )
1304- const partInstancesMap : Map < PartId , PartInstance > = new Map ( )
1305- const rundown = makeMockRundown ( rundownId , playlist )
1306- const rundowns = [ rundown ]
1307- const result = timing . updateDurations (
1308- 0 ,
1309- false ,
1310- playlist ,
1311- rundowns ,
1312- undefined ,
1313- partInstances ,
1314- partInstancesMap ,
1315- segmentsMap ,
1316- DEFAULT_DURATION ,
1317- { }
1318- )
1319- expect ( result ) . toEqual (
1320- literal < RundownTimingContext > ( {
1321- isLowResolution : false ,
1322- asDisplayedPlaylistDuration : 9240 ,
1323- asPlayedPlaylistDuration : 9240 ,
1324- currentPartInstanceId : null ,
1325- currentPartWillAutoNext : false ,
1326- currentTime : 0 ,
1327- rundownExpectedDurations : {
1328- [ rundownId ] : 4000 ,
1329- } ,
1330- rundownAsPlayedDurations : {
1331- [ rundownId ] : 9240 ,
1332- } ,
1333- partCountdown : {
1334- part1 : 0 ,
1335- part2 : 6000 ,
1336- part3 : 7240 ,
1337- part4 : 8240 ,
1338- } ,
1339- partDisplayDurations : {
1340- part1 : 6000 ,
1341- part2 : 1240 ,
1342- part3 : 1000 ,
1343- part4 : 1000 ,
1344- } ,
1345- partDisplayStartsAt : {
1346- part1 : 0 ,
1347- part2 : 6000 ,
1348- part3 : 7240 ,
1349- part4 : 8240 ,
1350- } ,
1351- partDurations : {
1352- part1 : 6000 ,
1353- part2 : 1240 ,
1354- part3 : 1000 ,
1355- part4 : 1000 ,
1356- } ,
1357- partExpectedDurations : {
1358- part1 : 6000 ,
1359- part2 : 1240 ,
1360- part3 : 1000 ,
1361- part4 : 1000 ,
1362- } ,
1363- partPlayed : {
1364- part1 : 0 ,
1365- part2 : 0 ,
1366- part3 : 0 ,
1367- part4 : 0 ,
1368- } ,
1369- partStartsAt : {
1370- part1 : 0 ,
1371- part2 : 6000 ,
1372- part3 : 7240 ,
1373- part4 : 8240 ,
1374- } ,
1375- remainingPlaylistDuration : 9240 ,
1376- totalPlaylistDuration : 9240 ,
1377- breakIsLastRundown : undefined ,
1378- remainingTimeOnCurrentPart : undefined ,
1379- rundownsBeforeNextBreak : undefined ,
1380- nextRundownAnchor : undefined ,
1381- } )
1382- )
1383- } )
1384-
13851264 it ( 'Handles part with autonext' , ( ) => {
13861265 const timing = new RundownTimingCalculator ( )
13871266 const playlist : DBRundownPlaylist = makeMockPlaylist ( )
0 commit comments