@@ -12,9 +12,6 @@ import { waitUntil } from '../../../__mocks__/helpers/jest'
12
12
import { setupDefaultStudioEnvironment , DefaultEnvironment } from '../../../__mocks__/helpers/database'
13
13
import { setLogLevel } from '../../logging'
14
14
import { IngestDeviceSecretSettings } from '@sofie-automation/corelib/dist/dataModel/PeripheralDeviceSettings/ingestDevice'
15
- import { MediaWorkFlow } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlows'
16
- import { MediaWorkFlowStep } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlowSteps'
17
- import { MediaManagerAPI } from '@sofie-automation/meteor-lib/dist/api/mediaManager'
18
15
import { MediaObject } from '@sofie-automation/shared-lib/dist/core/model/MediaObjects'
19
16
import {
20
17
IBlueprintPieceType ,
@@ -39,8 +36,6 @@ import { RundownId, RundownPlaylistId, SegmentId } from '@sofie-automation/corel
39
36
import { PeripheralDeviceAPIMethods } from '@sofie-automation/shared-lib/dist/peripheralDevice/methodsAPI'
40
37
import {
41
38
MediaObjects ,
42
- MediaWorkFlows ,
43
- MediaWorkFlowSteps ,
44
39
Parts ,
45
40
PeripheralDeviceCommands ,
46
41
PeripheralDevices ,
@@ -624,166 +619,6 @@ describe('test peripheralDevice general API methods', () => {
624
619
}
625
620
} )
626
621
627
- // test MediaManagerIntegration API
628
- describe ( 'Media Manager API' , ( ) => {
629
- let workFlowId : ProtectedString < any >
630
- let workStepIds : ProtectedString < any > [ ]
631
- let deviceId : ProtectedString < any >
632
- let device : PeripheralDevice
633
- beforeEach ( async ( ) => {
634
- workFlowId = getRandomId ( )
635
- workStepIds = [ getRandomId ( ) , getRandomId ( ) ]
636
- deviceId = getRandomId ( )
637
- env = await setupDefaultStudioEnvironment ( )
638
- await PeripheralDevices . insertAsync ( {
639
- _id : deviceId ,
640
- organizationId : null ,
641
- name : 'Mock Media Manager' ,
642
- deviceName : 'Media Manager' ,
643
- studioAndConfigId : {
644
- studioId : env . studio . _id ,
645
- configId : 'test' ,
646
- } ,
647
- category : PeripheralDeviceCategory . MEDIA_MANAGER ,
648
- configManifest : {
649
- deviceConfigSchema : JSONBlobStringify ( { } ) ,
650
- subdeviceManifest : { } ,
651
- } ,
652
- connected : true ,
653
- connectionId : '0' ,
654
- created : 0 ,
655
- lastConnected : 0 ,
656
- lastSeen : 0 ,
657
- status : {
658
- statusCode : StatusCode . GOOD ,
659
- } ,
660
- subType : '_process' ,
661
- token : 'MockToken' ,
662
- type : PeripheralDeviceType . MEDIA_MANAGER ,
663
- } )
664
- device = ( await PeripheralDevices . findOneAsync ( deviceId ) ) !
665
- await MediaWorkFlows . insertAsync ( {
666
- _id : workFlowId ,
667
- _rev : '1' ,
668
- created : 0 ,
669
- deviceId : device . _id ,
670
- priority : 1 ,
671
- source : 'MockSource' ,
672
- studioId : device . studioAndConfigId ! . studioId ,
673
- finished : false ,
674
- success : false ,
675
- } )
676
- await MediaWorkFlowSteps . insertAsync ( {
677
- _id : workStepIds [ 0 ] ,
678
- _rev : '1' ,
679
- criticalStep : false ,
680
- action : MediaManagerAPI . WorkStepAction . COPY ,
681
- deviceId : device . _id ,
682
- priority : 2 ,
683
- status : MediaManagerAPI . WorkStepStatus . IDLE ,
684
- studioId : device . studioAndConfigId ! . studioId ,
685
- workFlowId : workFlowId ,
686
- } )
687
- await MediaWorkFlowSteps . insertAsync ( {
688
- _id : workStepIds [ 1 ] ,
689
- _rev : '1' ,
690
- criticalStep : false ,
691
- action : MediaManagerAPI . WorkStepAction . GENERATE_METADATA ,
692
- deviceId : device . _id ,
693
- priority : 1 ,
694
- status : MediaManagerAPI . WorkStepStatus . IDLE ,
695
- studioId : device . studioAndConfigId ! . studioId ,
696
- workFlowId : workFlowId ,
697
- } )
698
- } )
699
- test ( 'getMediaWorkFlowRevisions' , async ( ) => {
700
- const workFlows = (
701
- await MediaWorkFlows . findFetchAsync ( {
702
- studioId : device . studioAndConfigId ! . studioId ,
703
- } )
704
- ) . map ( ( wf ) => ( {
705
- _id : wf . _id ,
706
- _rev : wf . _rev ,
707
- } ) )
708
- expect ( workFlows . length ) . toBeGreaterThan ( 0 )
709
- const res = await MeteorCall . peripheralDevice . getMediaWorkFlowRevisions ( device . _id , device . token )
710
- expect ( res ) . toHaveLength ( workFlows . length )
711
- expect ( res ) . toMatchObject ( workFlows )
712
- } )
713
- test ( 'getMediaWorkFlowStepRevisions' , async ( ) => {
714
- const workFlowSteps = (
715
- await MediaWorkFlowSteps . findFetchAsync ( {
716
- studioId : device . studioAndConfigId ! . studioId ,
717
- } )
718
- ) . map ( ( wf ) => ( {
719
- _id : wf . _id ,
720
- _rev : wf . _rev ,
721
- } ) )
722
- expect ( workFlowSteps . length ) . toBeGreaterThan ( 0 )
723
- const res = await MeteorCall . peripheralDevice . getMediaWorkFlowStepRevisions ( device . _id , device . token )
724
- expect ( res ) . toHaveLength ( workFlowSteps . length )
725
- expect ( res ) . toMatchObject ( workFlowSteps )
726
- } )
727
- describe ( 'updateMediaWorkFlow' , ( ) => {
728
- test ( 'update' , async ( ) => {
729
- const workFlow = await MediaWorkFlows . findOneAsync ( workFlowId )
730
-
731
- expect ( workFlow ) . toBeTruthy ( )
732
- const newWorkFlow = Object . assign ( { } , workFlow )
733
- newWorkFlow . _rev = '2'
734
- newWorkFlow . comment = 'New comment'
735
-
736
- await MeteorCall . peripheralDevice . updateMediaWorkFlow (
737
- device . _id ,
738
- device . token ,
739
- newWorkFlow . _id ,
740
- newWorkFlow
741
- )
742
-
743
- const updatedWorkFlow = await MediaWorkFlows . findOneAsync ( workFlowId )
744
- expect ( updatedWorkFlow ) . toMatchObject ( newWorkFlow )
745
- } )
746
- test ( 'remove' , async ( ) => {
747
- const workFlow = ( await MediaWorkFlows . findOneAsync ( workFlowId ) ) as MediaWorkFlow
748
- expect ( workFlow ) . toBeTruthy ( )
749
-
750
- await MeteorCall . peripheralDevice . updateMediaWorkFlow ( device . _id , device . token , workFlow . _id , null )
751
-
752
- const updatedWorkFlow = await MediaWorkFlows . findOneAsync ( workFlowId )
753
- expect ( updatedWorkFlow ) . toBeFalsy ( )
754
- } )
755
- } )
756
- describe ( 'updateMediaWorkFlowStep' , ( ) => {
757
- test ( 'update' , async ( ) => {
758
- const workStep = await MediaWorkFlowSteps . findOneAsync ( workStepIds [ 0 ] )
759
-
760
- expect ( workStep ) . toBeTruthy ( )
761
- const newWorkStep = Object . assign ( { } , workStep )
762
- newWorkStep . _rev = '2'
763
- newWorkStep . status = MediaManagerAPI . WorkStepStatus . WORKING
764
-
765
- await MeteorCall . peripheralDevice . updateMediaWorkFlowStep (
766
- device . _id ,
767
- device . token ,
768
- newWorkStep . _id ,
769
- newWorkStep
770
- )
771
-
772
- const updatedWorkFlow = await MediaWorkFlowSteps . findOneAsync ( workStepIds [ 0 ] )
773
- expect ( updatedWorkFlow ) . toMatchObject ( newWorkStep )
774
- } )
775
- test ( 'remove' , async ( ) => {
776
- const workStep = ( await MediaWorkFlowSteps . findOneAsync ( workStepIds [ 0 ] ) ) as MediaWorkFlowStep
777
- expect ( workStep ) . toBeTruthy ( )
778
-
779
- await MeteorCall . peripheralDevice . updateMediaWorkFlowStep ( device . _id , device . token , workStep . _id , null )
780
-
781
- const updatedWorkFlow = await MediaWorkFlowSteps . findOneAsync ( workStepIds [ 0 ] )
782
- expect ( updatedWorkFlow ) . toBeFalsy ( )
783
- } )
784
- } )
785
- } )
786
-
787
622
// test Media Scanner API
788
623
describe ( 'Media Scanner API' , ( ) => {
789
624
let deviceId : ProtectedString < any >
@@ -802,7 +637,7 @@ describe('test peripheralDevice general API methods', () => {
802
637
studioId : env . studio . _id ,
803
638
configId : 'test' ,
804
639
} ,
805
- category : PeripheralDeviceCategory . MEDIA_MANAGER ,
640
+ category : PeripheralDeviceCategory . PLAYOUT ,
806
641
configManifest : {
807
642
deviceConfigSchema : JSONBlobStringify ( { } ) ,
808
643
subdeviceManifest : { } ,
@@ -817,7 +652,7 @@ describe('test peripheralDevice general API methods', () => {
817
652
} ,
818
653
subType : '_process' ,
819
654
token : 'MockToken' ,
820
- type : PeripheralDeviceType . MEDIA_MANAGER ,
655
+ type : PeripheralDeviceType . PLAYOUT ,
821
656
} )
822
657
device = ( await PeripheralDevices . findOneAsync ( deviceId ) ) !
823
658
0 commit comments