diff --git a/src/api/agileLive/pipelines/multiviews/multiviews.ts b/src/api/agileLive/pipelines/multiviews/multiviews.ts index d92b269..c6ee588 100644 --- a/src/api/agileLive/pipelines/multiviews/multiviews.ts +++ b/src/api/agileLive/pipelines/multiviews/multiviews.ts @@ -53,11 +53,11 @@ export async function createMultiviewForPipeline( } const pipelineUUID = productionSettings.pipelines[multiviewIndex].pipeline_id!; - const sources = await getSourcesByIds( - sourceRefs - .filter((ref) => ref._id !== undefined) - .map((ref) => ref._id!.toString()) - ); + const sources = await getSourcesByIds( + sourceRefs + .filter((ref) => ref._id !== undefined) + .map((ref) => ref._id!.toString()) + ); const sourceRefsWithLabels = sourceRefs.map((ref) => { if (!ref.label) { const source = sources.find( diff --git a/src/api/agileLive/websocket.ts b/src/api/agileLive/websocket.ts index 4e26e8d..6f51466 100644 --- a/src/api/agileLive/websocket.ts +++ b/src/api/agileLive/websocket.ts @@ -41,5 +41,5 @@ export async function createControlPanelWebSocket() { close: () => { ws.close(); } - } + }; } diff --git a/src/api/manager/workflow.ts b/src/api/manager/workflow.ts index 1075322..0312261 100644 --- a/src/api/manager/workflow.ts +++ b/src/api/manager/workflow.ts @@ -50,6 +50,7 @@ import { Monitoring } from '../../interfaces/monitoring'; import { getDatabase } from '../mongoClient/dbClient'; import { updatedMonitoringForProduction } from './job/syncMonitoring'; import { createControlPanelWebSocket } from '../agileLive/websocket'; +import { ObjectId } from 'mongodb'; const isUsed = (pipeline: ResourcesPipelineResponse) => { const hasStreams = pipeline.streams.length > 0; @@ -90,7 +91,7 @@ async function connectIngestSources( source.ingest_source_name, false ); - const audioSettings = await getAudioMapping(source._id); + const audioSettings = await getAudioMapping(new ObjectId(source._id)); const newAudioMapping = audioSettings?.audio_stream?.audio_mapping; const audioMapping = newAudioMapping?.length ? newAudioMapping : [[0, 1]]; @@ -310,8 +311,12 @@ export async function stopProduction( ); const controlPanelWS = await createControlPanelWebSocket(); - const htmlSources = production.sources.filter((source) => source.type === 'html'); - const mediaPlayerSources = production.sources.filter((source) => source.type === 'mediaplayer'); + const htmlSources = production.sources.filter( + (source) => source.type === 'html' + ); + const mediaPlayerSources = production.sources.filter( + (source) => source.type === 'mediaplayer' + ); for (const source of production.sources) { for (const stream_uuid of source.stream_uuids || []) { @@ -322,7 +327,9 @@ export async function stopProduction( } htmlSources.map((source) => controlPanelWS.closeHtml(source.input_slot)); - mediaPlayerSources.map((source) => controlPanelWS.closeMediaplayer(source.input_slot)); + mediaPlayerSources.map((source) => + controlPanelWS.closeMediaplayer(source.input_slot) + ); for (const id of pipelineIds) { Log().info(`Stopping pipeline '${id}'`); @@ -458,20 +465,28 @@ export async function startProduction( // Get sources from the DB // Skapa en createHtmlWebSocket, spara const controlPanelWS = await createControlPanelWebSocket(); - const htmlSources = production.sources.filter((source) => source.type === 'html'); - const mediaPlayerSources = production.sources.filter((source) => source.type === 'mediaplayer'); + const htmlSources = production.sources.filter( + (source) => source.type === 'html' + ); + const mediaPlayerSources = production.sources.filter( + (source) => source.type === 'mediaplayer' + ); htmlSources.map((source) => controlPanelWS.createHtml(source.input_slot)); - mediaPlayerSources.map((source) => controlPanelWS.createMediaplayer(source.input_slot)); + mediaPlayerSources.map((source) => + controlPanelWS.createMediaplayer(source.input_slot) + ); controlPanelWS.close(); - + // Nedan behöver göras efter att vi har skapat en produktion // TODO: Hämta production.sources, för varje html-reference --> create i createHtmlWebSocket, för varje mediaplayer i production.sources skapa en createWebSocket const sources = await getSourcesByIds( - production.sources.filter((source) => source._id !== undefined).map((source) => { - return source._id!.toString(); - }) + production.sources + .filter((source) => source._id !== undefined) + .map((source) => { + return source._id!.toString(); + }) ).catch((error) => { if (error === "Can't connect to Database") { throw "Can't connect to Database"; diff --git a/src/components/sourceCard/SourceCard.tsx b/src/components/sourceCard/SourceCard.tsx index b2fc4e7..65fce8c 100644 --- a/src/components/sourceCard/SourceCard.tsx +++ b/src/components/sourceCard/SourceCard.tsx @@ -100,14 +100,15 @@ export default function SourceCard({