@@ -33,7 +33,7 @@ function createBasicResolvedPieceInstance(
33
33
const piece = literal < PieceInstancePiece > ( {
34
34
_id : protectString ( id ) ,
35
35
externalId : id ,
36
- name : id ,
36
+ name : `name- ${ id } ` ,
37
37
enable : {
38
38
start,
39
39
} ,
@@ -142,13 +142,37 @@ describe('resolveMediaPlayers', () => {
142
142
[ 1 , 2 ] ,
143
143
4500
144
144
)
145
- expect ( assignments . failedRequired ) . toEqual ( [ 'inst_2_clip_ghi' ] )
145
+ expect ( assignments . failedRequired ) . toEqual ( [ { id : 'inst_2_clip_ghi' , name : 'ghi' , pieceNames : [ 'name-2' ] } ] )
146
146
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
147
147
expect ( assignments . requests ) . toHaveLength ( 3 )
148
148
expect ( assignments . requests ) . toEqual ( [
149
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
150
- { end : 5400 , id : 'inst_1_clip_def' , playerId : 2 , start : 400 , optional : false } ,
151
- { end : 4800 , id : 'inst_2_clip_ghi' , playerId : undefined , start : 800 , optional : false } , // Massive overlap
149
+ {
150
+ end : 5400 ,
151
+ id : 'inst_0_clip_abc' ,
152
+ name : 'abc' ,
153
+ playerId : 1 ,
154
+ start : 400 ,
155
+ optional : false ,
156
+ pieceNames : [ 'name-0' ] ,
157
+ } ,
158
+ {
159
+ end : 5400 ,
160
+ id : 'inst_1_clip_def' ,
161
+ name : 'def' ,
162
+ playerId : 2 ,
163
+ start : 400 ,
164
+ optional : false ,
165
+ pieceNames : [ 'name-1' ] ,
166
+ } ,
167
+ {
168
+ end : 4800 ,
169
+ id : 'inst_2_clip_ghi' ,
170
+ name : 'ghi' ,
171
+ playerId : undefined ,
172
+ start : 800 ,
173
+ optional : false ,
174
+ pieceNames : [ 'name-2' ] ,
175
+ } , // Massive overlap
152
176
] )
153
177
154
178
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -189,13 +213,37 @@ describe('resolveMediaPlayers', () => {
189
213
[ 'player1' , 'player2' ] ,
190
214
4500
191
215
)
192
- expect ( assignments . failedRequired ) . toEqual ( [ 'inst_2_clip_ghi' ] )
216
+ expect ( assignments . failedRequired ) . toEqual ( [ { id : 'inst_2_clip_ghi' , name : 'ghi' , pieceNames : [ 'name-2' ] } ] )
193
217
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
194
218
expect ( assignments . requests ) . toHaveLength ( 3 )
195
219
expect ( assignments . requests ) . toEqual ( [
196
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 'player1' , start : 400 , optional : false } ,
197
- { end : 5400 , id : 'inst_1_clip_def' , playerId : 'player2' , start : 400 , optional : false } ,
198
- { end : 4800 , id : 'inst_2_clip_ghi' , playerId : undefined , start : 800 , optional : false } , // Massive overlap
220
+ {
221
+ end : 5400 ,
222
+ id : 'inst_0_clip_abc' ,
223
+ name : 'abc' ,
224
+ playerId : 'player1' ,
225
+ start : 400 ,
226
+ optional : false ,
227
+ pieceNames : [ 'name-0' ] ,
228
+ } ,
229
+ {
230
+ end : 5400 ,
231
+ id : 'inst_1_clip_def' ,
232
+ name : 'def' ,
233
+ playerId : 'player2' ,
234
+ start : 400 ,
235
+ optional : false ,
236
+ pieceNames : [ 'name-1' ] ,
237
+ } ,
238
+ {
239
+ end : 4800 ,
240
+ id : 'inst_2_clip_ghi' ,
241
+ name : 'ghi' ,
242
+ playerId : undefined ,
243
+ start : 800 ,
244
+ optional : false ,
245
+ pieceNames : [ 'name-2' ] ,
246
+ } , // Massive overlap
199
247
] )
200
248
201
249
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -236,13 +284,37 @@ describe('resolveMediaPlayers', () => {
236
284
[ 1 , 'player2' ] ,
237
285
4500
238
286
)
239
- expect ( assignments . failedRequired ) . toEqual ( [ 'inst_2_clip_ghi' ] )
287
+ expect ( assignments . failedRequired ) . toEqual ( [ { id : 'inst_2_clip_ghi' , name : 'ghi' , pieceNames : [ 'name-2' ] } ] )
240
288
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
241
289
expect ( assignments . requests ) . toHaveLength ( 3 )
242
290
expect ( assignments . requests ) . toEqual ( [
243
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
244
- { end : 5400 , id : 'inst_1_clip_def' , playerId : 'player2' , start : 400 , optional : false } ,
245
- { end : 4800 , id : 'inst_2_clip_ghi' , playerId : undefined , start : 800 , optional : false } , // Massive overlap
291
+ {
292
+ end : 5400 ,
293
+ id : 'inst_0_clip_abc' ,
294
+ name : 'abc' ,
295
+ playerId : 1 ,
296
+ start : 400 ,
297
+ optional : false ,
298
+ pieceNames : [ 'name-0' ] ,
299
+ } ,
300
+ {
301
+ end : 5400 ,
302
+ id : 'inst_1_clip_def' ,
303
+ name : 'def' ,
304
+ playerId : 'player2' ,
305
+ start : 400 ,
306
+ optional : false ,
307
+ pieceNames : [ 'name-1' ] ,
308
+ } ,
309
+ {
310
+ end : 4800 ,
311
+ id : 'inst_2_clip_ghi' ,
312
+ name : 'ghi' ,
313
+ playerId : undefined ,
314
+ start : 800 ,
315
+ optional : false ,
316
+ pieceNames : [ 'name-2' ] ,
317
+ } , // Massive overlap
246
318
] )
247
319
248
320
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -286,7 +358,15 @@ describe('resolveMediaPlayers', () => {
286
358
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
287
359
expect ( assignments . requests ) . toHaveLength ( 1 )
288
360
expect ( assignments . requests ) . toEqual ( [
289
- { end : 7400 , id : 'tmp_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
361
+ {
362
+ end : 7400 ,
363
+ id : 'tmp_clip_abc' ,
364
+ name : 'abc' ,
365
+ playerId : 1 ,
366
+ start : 400 ,
367
+ optional : false ,
368
+ pieceNames : [ 'name-0' , 'name-1' , 'name-2' , 'name-3' ] ,
369
+ } ,
290
370
] )
291
371
292
372
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 4 )
@@ -335,9 +415,33 @@ describe('resolveMediaPlayers', () => {
335
415
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
336
416
expect ( assignments . requests ) . toHaveLength ( 3 )
337
417
expect ( assignments . requests ) . toEqual ( [
338
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
339
- { end : 4800 , id : 'inst_1_clip_def' , playerId : 2 , start : 800 , optional : false } ,
340
- { end : 7400 , id : 'inst_3_clip_ghi' , playerId : 2 , start : 6400 , optional : false } ,
418
+ {
419
+ end : 5400 ,
420
+ id : 'inst_0_clip_abc' ,
421
+ name : 'abc' ,
422
+ playerId : 1 ,
423
+ start : 400 ,
424
+ optional : false ,
425
+ pieceNames : [ 'name-0' ] ,
426
+ } ,
427
+ {
428
+ end : 4800 ,
429
+ id : 'inst_1_clip_def' ,
430
+ name : 'def' ,
431
+ playerId : 2 ,
432
+ start : 800 ,
433
+ optional : false ,
434
+ pieceNames : [ 'name-1' ] ,
435
+ } ,
436
+ {
437
+ end : 7400 ,
438
+ id : 'inst_3_clip_ghi' ,
439
+ name : 'ghi' ,
440
+ playerId : 2 ,
441
+ start : 6400 ,
442
+ optional : false ,
443
+ pieceNames : [ 'name-3' ] ,
444
+ } ,
341
445
] )
342
446
343
447
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -382,9 +486,33 @@ describe('resolveMediaPlayers', () => {
382
486
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
383
487
expect ( assignments . requests ) . toHaveLength ( 3 )
384
488
expect ( assignments . requests ) . toEqual ( [
385
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
386
- { end : 6800 , id : 'inst_1_clip_def' , playerId : 2 , start : 800 , optional : false } ,
387
- { end : 6400 , id : 'inst_3_clip_ghi' , playerId : 1 , start : 5400 , optional : false } ,
489
+ {
490
+ end : 5400 ,
491
+ id : 'inst_0_clip_abc' ,
492
+ name : 'abc' ,
493
+ playerId : 1 ,
494
+ start : 400 ,
495
+ optional : false ,
496
+ pieceNames : [ 'name-0' ] ,
497
+ } ,
498
+ {
499
+ end : 6800 ,
500
+ id : 'inst_1_clip_def' ,
501
+ name : 'def' ,
502
+ playerId : 2 ,
503
+ start : 800 ,
504
+ optional : false ,
505
+ pieceNames : [ 'name-1' ] ,
506
+ } ,
507
+ {
508
+ end : 6400 ,
509
+ id : 'inst_3_clip_ghi' ,
510
+ name : 'ghi' ,
511
+ playerId : 1 ,
512
+ start : 5400 ,
513
+ optional : false ,
514
+ pieceNames : [ 'name-3' ] ,
515
+ } ,
388
516
] )
389
517
390
518
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -429,9 +557,33 @@ describe('resolveMediaPlayers', () => {
429
557
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
430
558
expect ( assignments . requests ) . toHaveLength ( 3 )
431
559
expect ( assignments . requests ) . toEqual ( [
432
- { end : 5400 , id : 'inst_0_clip_abc' , playerId : 1 , start : 400 , optional : false } ,
433
- { end : 6800 , id : 'inst_1_clip_def' , playerId : 2 , start : 800 , optional : false } ,
434
- { end : 6400 , id : 'inst_3_clip_ghi' , playerId : 1 , start : 5400 , optional : false } ,
560
+ {
561
+ end : 5400 ,
562
+ id : 'inst_0_clip_abc' ,
563
+ name : 'abc' ,
564
+ playerId : 1 ,
565
+ start : 400 ,
566
+ optional : false ,
567
+ pieceNames : [ 'name-0' ] ,
568
+ } ,
569
+ {
570
+ end : 6800 ,
571
+ id : 'inst_1_clip_def' ,
572
+ name : 'def' ,
573
+ playerId : 2 ,
574
+ start : 800 ,
575
+ optional : false ,
576
+ pieceNames : [ 'name-1' ] ,
577
+ } ,
578
+ {
579
+ end : 6400 ,
580
+ id : 'inst_3_clip_ghi' ,
581
+ name : 'ghi' ,
582
+ playerId : 1 ,
583
+ start : 5400 ,
584
+ optional : false ,
585
+ pieceNames : [ 'name-3' ] ,
586
+ } ,
435
587
] )
436
588
437
589
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -454,11 +606,13 @@ describe('resolveMediaPlayers', () => {
454
606
const previousAssignments : ABSessionAssignments = {
455
607
inst_0_clip_abc : {
456
608
sessionId : 'inst_0_clip_abc' ,
609
+ sessionName : 'abc' ,
457
610
playerId : 5 ,
458
611
lookahead : false ,
459
612
} ,
460
613
inst_1_clip_def : {
461
614
sessionId : 'inst_1_clip_def' ,
615
+ sessionName : 'def' ,
462
616
playerId : 1 ,
463
617
lookahead : true ,
464
618
} ,
@@ -483,13 +637,37 @@ describe('resolveMediaPlayers', () => {
483
637
[ 1 , 2 ] ,
484
638
0
485
639
)
486
- expect ( assignments . failedRequired ) . toEqual ( [ 'inst_2_clip_ghi' ] )
640
+ expect ( assignments . failedRequired ) . toEqual ( [ { id : 'inst_2_clip_ghi' , name : 'ghi' , pieceNames : [ 'name-2' ] } ] )
487
641
expect ( assignments . failedOptional ) . toHaveLength ( 0 )
488
642
expect ( assignments . requests ) . toHaveLength ( 3 )
489
643
expect ( assignments . requests ) . toEqual ( [
490
- { end : 7400 , id : 'inst_0_clip_abc' , playerId : 2 , start : 2400 , optional : false } ,
491
- { end : 7400 , id : 'inst_1_clip_def' , playerId : 1 , start : 2400 , optional : false } ,
492
- { end : 6800 , id : 'inst_2_clip_ghi' , playerId : undefined , start : 2800 , optional : false } ,
644
+ {
645
+ end : 7400 ,
646
+ id : 'inst_0_clip_abc' ,
647
+ name : 'abc' ,
648
+ playerId : 2 ,
649
+ start : 2400 ,
650
+ optional : false ,
651
+ pieceNames : [ 'name-0' ] ,
652
+ } ,
653
+ {
654
+ end : 7400 ,
655
+ id : 'inst_1_clip_def' ,
656
+ name : 'def' ,
657
+ playerId : 1 ,
658
+ start : 2400 ,
659
+ optional : false ,
660
+ pieceNames : [ 'name-1' ] ,
661
+ } ,
662
+ {
663
+ end : 6800 ,
664
+ id : 'inst_2_clip_ghi' ,
665
+ name : 'ghi' ,
666
+ playerId : undefined ,
667
+ start : 2800 ,
668
+ optional : false ,
669
+ pieceNames : [ 'name-2' ] ,
670
+ } ,
493
671
] )
494
672
495
673
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
@@ -512,11 +690,13 @@ describe('resolveMediaPlayers', () => {
512
690
const previousAssignments : ABSessionAssignments = {
513
691
inst_0_clip_abc : {
514
692
sessionId : 'inst_0_clip_abc' ,
693
+ sessionName : 'abc' ,
515
694
playerId : 2 ,
516
695
lookahead : false ,
517
696
} ,
518
697
inst_1_clip_def : {
519
698
sessionId : 'inst_1_clip_def' ,
699
+ sessionName : 'def' ,
520
700
playerId : 1 ,
521
701
lookahead : false ,
522
702
} ,
@@ -542,12 +722,36 @@ describe('resolveMediaPlayers', () => {
542
722
0
543
723
)
544
724
expect ( assignments . failedRequired ) . toHaveLength ( 0 )
545
- expect ( assignments . failedOptional ) . toEqual ( [ 'inst_1_clip_def' ] )
725
+ expect ( assignments . failedOptional ) . toEqual ( [ { id : 'inst_1_clip_def' , name : 'def' , pieceNames : [ 'name-1' ] } ] )
546
726
expect ( assignments . requests ) . toHaveLength ( 3 )
547
727
expect ( assignments . requests ) . toEqual ( [
548
- { end : 7400 , id : 'inst_0_clip_abc' , playerId : 2 , start : 2400 , optional : false } ,
549
- { end : 7400 , id : 'inst_1_clip_def' , playerId : undefined , start : 2400 , optional : true } ,
550
- { end : 6800 , id : 'inst_2_clip_ghi' , playerId : 1 , start : 2800 , optional : false } ,
728
+ {
729
+ end : 7400 ,
730
+ id : 'inst_0_clip_abc' ,
731
+ name : 'abc' ,
732
+ playerId : 2 ,
733
+ start : 2400 ,
734
+ optional : false ,
735
+ pieceNames : [ 'name-0' ] ,
736
+ } ,
737
+ {
738
+ end : 7400 ,
739
+ id : 'inst_1_clip_def' ,
740
+ name : 'def' ,
741
+ playerId : undefined ,
742
+ start : 2400 ,
743
+ optional : true ,
744
+ pieceNames : [ 'name-1' ] ,
745
+ } ,
746
+ {
747
+ end : 6800 ,
748
+ id : 'inst_2_clip_ghi' ,
749
+ name : 'ghi' ,
750
+ playerId : 1 ,
751
+ start : 2800 ,
752
+ optional : false ,
753
+ pieceNames : [ 'name-2' ] ,
754
+ } ,
551
755
] )
552
756
553
757
expect ( mockGetPieceSessionId ) . toHaveBeenCalledTimes ( 3 )
0 commit comments