@@ -11,10 +11,7 @@ import { getCurrentTime } from '../../lib/lib'
1111import { waitUntil } from '../../../__mocks__/helpers/jest'
1212import { setupDefaultStudioEnvironment , DefaultEnvironment } from '../../../__mocks__/helpers/database'
1313import { setLogLevel } from '../../logging'
14- import {
15- IngestDeviceSettings ,
16- IngestDeviceSecretSettings ,
17- } from '@sofie-automation/corelib/dist/dataModel/PeripheralDeviceSettings/ingestDevice'
14+ import { IngestDeviceSecretSettings } from '@sofie-automation/corelib/dist/dataModel/PeripheralDeviceSettings/ingestDevice'
1815import { MediaWorkFlow } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlows'
1916import { MediaWorkFlowStep } from '@sofie-automation/shared-lib/dist/core/model/MediaWorkFlowSteps'
2017import { MediaManagerAPI } from '@sofie-automation/meteor-lib/dist/api/mediaManager'
@@ -415,7 +412,7 @@ describe('test peripheralDevice general API methods', () => {
415412 expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
416413 1 ,
417414 StudioJobs . OnPlayoutPlaybackChanged ,
418- device . studioId ,
415+ device . studioAndConfigId ! . studioId ,
419416 literal < Parameters < StudioJobFunc [ StudioJobs . OnPlayoutPlaybackChanged ] > [ 0 ] > ( {
420417 playlistId : rundownPlaylistID ,
421418 changes : [
@@ -477,7 +474,7 @@ describe('test peripheralDevice general API methods', () => {
477474 expect ( QueueStudioJobSpy ) . toHaveBeenNthCalledWith (
478475 1 ,
479476 StudioJobs . OnTimelineTriggerTime ,
480- device . studioId ,
477+ device . studioAndConfigId ! . studioId ,
481478 literal < OnTimelineTriggerTimeProps > ( {
482479 results : timelineTriggerTimeResult ,
483480 } )
@@ -559,7 +556,7 @@ describe('test peripheralDevice general API methods', () => {
559556 expect ( ( deviceWithSecretToken . secretSettings as IngestDeviceSecretSettings ) . accessToken ) . toBe (
560557 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
561558 )
562- expect ( ( deviceWithSecretToken . settings as IngestDeviceSettings ) . secretAccessToken ) . toBe ( true )
559+ expect ( deviceWithSecretToken . secretSettingsStatus ?. accessToken ) . toBe ( true )
563560 } )
564561
565562 test ( 'uninitialize' , async ( ) => {
@@ -646,8 +643,10 @@ describe('test peripheralDevice general API methods', () => {
646643 organizationId : null ,
647644 name : 'Mock Media Manager' ,
648645 deviceName : 'Media Manager' ,
649- studioId : env . studio . _id ,
650- settings : { } ,
646+ studioAndConfigId : {
647+ studioId : env . studio . _id ,
648+ configId : 'test' ,
649+ } ,
651650 category : PeripheralDeviceCategory . MEDIA_MANAGER ,
652651 configManifest : {
653652 deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -673,7 +672,7 @@ describe('test peripheralDevice general API methods', () => {
673672 deviceId : device . _id ,
674673 priority : 1 ,
675674 source : 'MockSource' ,
676- studioId : device . studioId ! ,
675+ studioId : device . studioAndConfigId ! . studioId ,
677676 finished : false ,
678677 success : false ,
679678 } )
@@ -685,7 +684,7 @@ describe('test peripheralDevice general API methods', () => {
685684 deviceId : device . _id ,
686685 priority : 2 ,
687686 status : MediaManagerAPI . WorkStepStatus . IDLE ,
688- studioId : device . studioId ! ,
687+ studioId : device . studioAndConfigId ! . studioId ,
689688 workFlowId : workFlowId ,
690689 } )
691690 await MediaWorkFlowSteps . insertAsync ( {
@@ -696,14 +695,14 @@ describe('test peripheralDevice general API methods', () => {
696695 deviceId : device . _id ,
697696 priority : 1 ,
698697 status : MediaManagerAPI . WorkStepStatus . IDLE ,
699- studioId : device . studioId ! ,
698+ studioId : device . studioAndConfigId ! . studioId ,
700699 workFlowId : workFlowId ,
701700 } )
702701 } )
703702 test ( 'getMediaWorkFlowRevisions' , async ( ) => {
704703 const workFlows = (
705704 await MediaWorkFlows . findFetchAsync ( {
706- studioId : device . studioId ,
705+ studioId : device . studioAndConfigId ! . studioId ,
707706 } )
708707 ) . map ( ( wf ) => ( {
709708 _id : wf . _id ,
@@ -717,7 +716,7 @@ describe('test peripheralDevice general API methods', () => {
717716 test ( 'getMediaWorkFlowStepRevisions' , async ( ) => {
718717 const workFlowSteps = (
719718 await MediaWorkFlowSteps . findFetchAsync ( {
720- studioId : device . studioId ,
719+ studioId : device . studioAndConfigId ! . studioId ,
721720 } )
722721 ) . map ( ( wf ) => ( {
723722 _id : wf . _id ,
@@ -802,8 +801,10 @@ describe('test peripheralDevice general API methods', () => {
802801 organizationId : null ,
803802 name : 'Mock Media Manager' ,
804803 deviceName : 'Media Manager' ,
805- studioId : env . studio . _id ,
806- settings : { } ,
804+ studioAndConfigId : {
805+ studioId : env . studio . _id ,
806+ configId : 'test' ,
807+ } ,
807808 category : PeripheralDeviceCategory . MEDIA_MANAGER ,
808809 configManifest : {
809810 deviceConfigSchema : JSONBlobStringify ( { } ) ,
@@ -837,7 +838,7 @@ describe('test peripheralDevice general API methods', () => {
837838 mediaSize : 10 ,
838839 mediaTime : 0 ,
839840 objId : MOCK_OBJID ,
840- studioId : device . studioId ! ,
841+ studioId : device . studioAndConfigId ! . studioId ,
841842 thumbSize : 0 ,
842843 thumbTime : 0 ,
843844 tinf : '' ,
@@ -846,7 +847,7 @@ describe('test peripheralDevice general API methods', () => {
846847 test ( 'getMediaObjectRevisions' , async ( ) => {
847848 const mobjects = (
848849 await MediaObjects . findFetchAsync ( {
849- studioId : device . studioId ,
850+ studioId : device . studioAndConfigId ! . studioId ,
850851 } )
851852 ) . map ( ( mo ) => ( {
852853 _id : mo . _id ,
@@ -867,7 +868,7 @@ describe('test peripheralDevice general API methods', () => {
867868 test ( 'update' , async ( ) => {
868869 const mo = ( await MediaObjects . findOneAsync ( {
869870 collectionId : MOCK_COLLECTION ,
870- studioId : device . studioId ! ,
871+ studioId : device . studioAndConfigId ! . studioId ,
871872 } ) ) as MediaObject
872873 expect ( mo ) . toBeTruthy ( )
873874
@@ -885,14 +886,14 @@ describe('test peripheralDevice general API methods', () => {
885886
886887 const updateMo = await MediaObjects . findOneAsync ( {
887888 collectionId : MOCK_COLLECTION ,
888- studioId : device . studioId ! ,
889+ studioId : device . studioAndConfigId ! . studioId ,
889890 } )
890891 expect ( updateMo ) . toMatchObject ( newMo )
891892 } )
892893 test ( 'remove' , async ( ) => {
893894 const mo = ( await MediaObjects . findOneAsync ( {
894895 collectionId : MOCK_COLLECTION ,
895- studioId : device . studioId ! ,
896+ studioId : device . studioAndConfigId ! . studioId ,
896897 } ) ) as MediaObject
897898 expect ( mo ) . toBeTruthy ( )
898899
@@ -906,7 +907,7 @@ describe('test peripheralDevice general API methods', () => {
906907
907908 const updateMo = await MediaObjects . findOneAsync ( {
908909 collectionId : MOCK_COLLECTION ,
909- studioId : device . studioId ! ,
910+ studioId : device . studioAndConfigId ! . studioId ,
910911 } )
911912 expect ( updateMo ) . toBeFalsy ( )
912913 } )
0 commit comments