From 7b08c29a52994a84b61251254b24d39d0f74e028 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Thu, 31 Oct 2024 16:22:57 +0100 Subject: [PATCH 01/15] test: added consol-logs --- src/app/production/[id]/page.tsx | 96 ++++++++++++++++++- .../ConfigureMultiviewModal.tsx | 1 + .../MultiviewLayoutSettings.tsx | 4 + src/components/pipeline/PipelineCard.tsx | 5 + src/hooks/productions.ts | 5 +- src/hooks/useConfigureMultiviewLayout.tsx | 1 + 6 files changed, 107 insertions(+), 5 deletions(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index b1ec1e36..0e4a8d5d 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -163,14 +163,31 @@ export default function ProductionConfiguration({ params }: PageProps) { locked || !pipelinesAreSelected; + useEffect(() => { + console.log( + 'anything', + !!productionSetup?.production_settings.pipelines[0] + ); + console.log( + 'pipeline_id', + productionSetup?.production_settings.pipelines[0].pipeline_id + ); + }, [productionSetup?.production_settings.pipelines]); + useEffect(() => { refreshPipelines(); refreshControlPanels(); }, [productionSetup?.isActive]); const setSelectedControlPanel = (controlPanel: string[]) => { + console.log('RUNNING'); setProductionSetup((prevState) => { + console.log('setSelectedControlPanel - prevState:', prevState); if (!prevState) return; + console.log( + 'PUT REQUEST:', + prevState.production_settings.pipelines[0].pipeline_id + ); putProduction(prevState._id, { ...prevState, production_settings: { @@ -206,12 +223,26 @@ export default function ProductionConfiguration({ params }: PageProps) { foundPipeline.pipeline_name = pipelineName; } setSelectedPreset(selectedPresetCopy); + console.log( + 'RUNNING selectedPresetCopy', + selectedPresetCopy?.pipelines[0].pipeline_id + ); + console.log('RUNNING foundPipeline', foundPipeline?.pipeline_id); + console.log( + 'RUNNING selectedPreset', + selectedPreset?.pipelines[0].pipeline_id + ); setProductionSetup((prevState) => { + console.log('setSelectedPipelineName - prevState:', prevState); const updatedPipelines = prevState?.production_settings.pipelines; if (!updatedPipelines) return; updatedPipelines[pipelineIndex].pipeline_name = pipelineName; updatedPipelines[pipelineIndex].pipeline_id = id; updatedPipelines[pipelineIndex].outputs = []; + console.log( + 'PUT REQUEST:', + prevState.production_settings.pipelines[0].pipeline_id + ); putProduction(prevState._id, { ...prevState, production_settings: { @@ -231,11 +262,20 @@ export default function ProductionConfiguration({ params }: PageProps) { const refreshProduction = () => { getProduction(params.id).then((config) => { + console.log( + 'REFRESH RUNNING', + params.id, + config.production_settings.pipelines[0].pipeline_id + ); // check if production has pipelines in use or control panels in use, if so update production const production = config.isActive ? config : checkProductionPipelines(config, pipelines); - + console.log('REFRESH pipelines', pipelines); + console.log( + 'PUT REQUEST:', + production.production_settings.pipelines[0].pipeline_id + ); putProduction(production._id, production); setProductionSetup(production); setConfigurationName(production.name); @@ -257,6 +297,7 @@ export default function ProductionConfiguration({ params }: PageProps) { }; useEffect(() => { + console.log('REFRESH()'); refreshProduction(); }, []); @@ -339,14 +380,23 @@ export default function ProductionConfiguration({ params }: PageProps) { ); } } - + console.log( + 'PUT REQUEST:', + updatedPreset.production_settings.pipelines[0].pipeline_id + ); putProduction(productionSetup?._id.toString(), updatedPreset).then(() => { + console.log('REFRESH()'); refreshProduction(); }); }; const updateProduction = (id: string, productionSetup: Production) => { + console.log('RUNNING'); setProductionSetup(productionSetup); + console.log( + 'PUT REQUEST:', + productionSetup.production_settings.pipelines[0].pipeline_id + ); putProduction(id, productionSetup); }; @@ -400,7 +450,7 @@ export default function ProductionConfiguration({ params }: PageProps) { ) } }; - + console.log('RUNNING'); setProductionSetup(updatedProduction); }); } @@ -466,7 +516,12 @@ export default function ProductionConfiguration({ params }: PageProps) { productionSetup: Production ) => { const updatedSetup = updateSetupItem(source, productionSetup); + console.log('RUNNING'); setProductionSetup(updatedSetup); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0].pipeline_id + ); putProduction(updatedSetup._id.toString(), updatedSetup); updateMultiview(source, updatedSetup); }; @@ -480,7 +535,12 @@ export default function ProductionConfiguration({ params }: PageProps) { ...productionSetup, name: nameChange } as Production; + console.log('RUNNING'); setProductionSetup(updatedSetup); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0].pipeline_id + ); putProduction(updatedSetup._id.toString(), updatedSetup); }; @@ -535,6 +595,7 @@ export default function ProductionConfiguration({ params }: PageProps) { } } as Production; updatedSetup.production_settings.pipelines[0].multiviews = [multiview]; + console.log('RUNNING'); setProductionSetup(updatedSetup); } @@ -641,8 +702,14 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; + console.log('RUNNING'); setProductionSetup(updatedSetup); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0].pipeline_id + ); putProduction(updatedSetup._id.toString(), updatedSetup).then(() => { + console.log('REFRESH()'); refreshProduction(); }); @@ -669,8 +736,14 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; + console.log('RUNNING'); setProductionSetup(updatedSetup); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0].pipeline_id + ); putProduction(updatedSetup._id.toString(), updatedSetup).then(() => { + console.log('REFRESH()'); refreshProduction(); }); @@ -786,8 +859,10 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; + console.log('RUNNING'); setProductionSetup(result); updateMultiview(sourceToAdd, result); + console.log('REFRESH()'); refreshProduction(); setAddSourceModal(false); setSelectedSource(undefined); @@ -848,6 +923,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; + console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setSelectedSourceRef(undefined); @@ -869,6 +945,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; + console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -904,6 +981,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; + console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); } @@ -950,6 +1028,7 @@ export default function ProductionConfiguration({ params }: PageProps) { if (!updatedSetup) return; updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then((result) => { if (!result) return; + console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -1032,7 +1111,10 @@ export default function ProductionConfiguration({ params }: PageProps) { production={memoizedProduction} /> { + console.log('REFRESH()'); + refreshProduction(); + }} production={productionSetup} disabled={ (!selectedPreset ? true : false) || @@ -1116,7 +1198,13 @@ export default function ProductionConfiguration({ params }: PageProps) { ingestSourceId ); if (!updatedSetup) return; + console.log('RUNNING'); setProductionSetup(updatedSetup); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0] + .pipeline_id + ); putProduction( updatedSetup._id.toString(), updatedSetup diff --git a/src/components/modal/configureMultiviewModal/ConfigureMultiviewModal.tsx b/src/components/modal/configureMultiviewModal/ConfigureMultiviewModal.tsx index 11b2fac3..bdb79573 100644 --- a/src/components/modal/configureMultiviewModal/ConfigureMultiviewModal.tsx +++ b/src/components/modal/configureMultiviewModal/ConfigureMultiviewModal.tsx @@ -137,6 +137,7 @@ export function ConfigureMultiviewModal({ return; } + console.log('production ID - to save', newMultiviewLayout?._id); await addNewLayout(newMultiviewLayout); setNewMultiviewLayout(null); setLayoutModalOpen(false); diff --git a/src/components/modal/configureMultiviewModal/MultiviewLayoutSettings/MultiviewLayoutSettings.tsx b/src/components/modal/configureMultiviewModal/MultiviewLayoutSettings/MultiviewLayoutSettings.tsx index f5e6db13..0d732fa2 100644 --- a/src/components/modal/configureMultiviewModal/MultiviewLayoutSettings/MultiviewLayoutSettings.tsx +++ b/src/components/modal/configureMultiviewModal/MultiviewLayoutSettings/MultiviewLayoutSettings.tsx @@ -60,6 +60,10 @@ export default function MultiviewLayoutSettings({ newPresetName ); + useEffect(() => { + console.log('production ID - main layout', production?._id); + }, [production?._id]); + const deleteLayout = useDeleteMultiviewLayout(); const t = useTranslate(); diff --git a/src/components/pipeline/PipelineCard.tsx b/src/components/pipeline/PipelineCard.tsx index 1349a18c..cdea3c53 100644 --- a/src/components/pipeline/PipelineCard.tsx +++ b/src/components/pipeline/PipelineCard.tsx @@ -18,6 +18,11 @@ export function PipelineCard({ pipelineId, isActive }: PipelineCardProps) { }, [isActive]); const SrtInfo = data?.status; + + useEffect(() => { + console.log('SrtInfo', SrtInfo); + }, [SrtInfo]); + if (SrtInfo === undefined) { return null; } diff --git a/src/hooks/productions.ts b/src/hooks/productions.ts index f3e26867..1d6539a5 100644 --- a/src/hooks/productions.ts +++ b/src/hooks/productions.ts @@ -27,7 +27,9 @@ export function useGetProduction() { headers: [['x-api-key', `Bearer ${API_SECRET_KEY}`]] }); if (response.ok) { - return response.json(); + const res = response.json(); + console.log('GET RESPONSE:', res); + return res; } throw await response.text(); }; @@ -35,6 +37,7 @@ export function useGetProduction() { export function usePutProduction() { return async (id: string, production: Production): Promise => { + console.log('PUT REQUEST:', production.production_settings.pipelines[0].pipeline_id); const response = await fetch(`/api/manager/productions/${id}`, { method: 'PUT', headers: [['x-api-key', `Bearer ${API_SECRET_KEY}`]], diff --git a/src/hooks/useConfigureMultiviewLayout.tsx b/src/hooks/useConfigureMultiviewLayout.tsx index 1338d1a3..de7ca354 100644 --- a/src/hooks/useConfigureMultiviewLayout.tsx +++ b/src/hooks/useConfigureMultiviewLayout.tsx @@ -16,6 +16,7 @@ export function useConfigureMultiviewLayout( useEffect(() => { if (productionId && preset && (defaultLabel || source)) { + console.log('production ID - layout hook', productionId); const arr: MultiviewViews[] = []; preset.layout.views.map((item, index) => { if (index.toString() === viewId) { From 785877ee83f0c041b405afe428aa38fc36c3e01f Mon Sep 17 00:00:00 2001 From: malmen237 Date: Thu, 31 Oct 2024 16:36:56 +0100 Subject: [PATCH 02/15] fix: lint errors --- src/hooks/productions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/productions.ts b/src/hooks/productions.ts index 1d6539a5..33f44597 100644 --- a/src/hooks/productions.ts +++ b/src/hooks/productions.ts @@ -37,7 +37,10 @@ export function useGetProduction() { export function usePutProduction() { return async (id: string, production: Production): Promise => { - console.log('PUT REQUEST:', production.production_settings.pipelines[0].pipeline_id); + console.log( + 'PUT REQUEST:', + production.production_settings.pipelines[0].pipeline_id + ); const response = await fetch(`/api/manager/productions/${id}`, { method: 'PUT', headers: [['x-api-key', `Bearer ${API_SECRET_KEY}`]], From cd47fbe665825ce66b035b14691aa9de35a5a860 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Tue, 5 Nov 2024 09:25:41 +0100 Subject: [PATCH 03/15] fix: added fix and more logs --- .../renderingengine/renderingengine.ts | 1 + src/app/production/[id]/page.tsx | 79 ++++++++++++------- src/components/copyToClipboard/CopyItem.tsx | 11 ++- .../copyToClipboard/CopyToClipboard.tsx | 5 +- .../dropDown/PipelineNameDropDown.tsx | 4 +- .../productionsList/ProductionsListItem.tsx | 4 + .../startProduction/StartProductionButton.tsx | 8 ++ src/hooks/productions.ts | 5 -- 8 files changed, 78 insertions(+), 39 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 15cb7428..3422758d 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -520,6 +520,7 @@ export async function deleteMediaFromPipeline( export async function getPipelineRenderingEngine( pipelineUuid: string ): Promise { + console.log('getPipelineRenderingEngine', pipelineUuid); const response = await fetch( new URL( LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/renderingengine`, diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index 0e4a8d5d..dc19b979 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -170,9 +170,9 @@ export default function ProductionConfiguration({ params }: PageProps) { ); console.log( 'pipeline_id', - productionSetup?.production_settings.pipelines[0].pipeline_id + productionSetup?.production_settings?.pipelines[0].pipeline_id ); - }, [productionSetup?.production_settings.pipelines]); + }, [productionSetup?.production_settings?.pipelines]); useEffect(() => { refreshPipelines(); @@ -180,9 +180,9 @@ export default function ProductionConfiguration({ params }: PageProps) { }, [productionSetup?.isActive]); const setSelectedControlPanel = (controlPanel: string[]) => { - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup((prevState) => { - console.log('setSelectedControlPanel - prevState:', prevState); + // console.log('setSelectedControlPanel - prevState:', prevState); if (!prevState) return; console.log( 'PUT REQUEST:', @@ -216,6 +216,12 @@ export default function ProductionConfiguration({ params }: PageProps) { pipelineName?: string, id?: string ) => { + console.log( + 'RUNNING setSelectedPipelineName', + pipelineIndex, + pipelineName, + id + ); const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; if (foundPipeline) { @@ -223,17 +229,17 @@ export default function ProductionConfiguration({ params }: PageProps) { foundPipeline.pipeline_name = pipelineName; } setSelectedPreset(selectedPresetCopy); - console.log( - 'RUNNING selectedPresetCopy', - selectedPresetCopy?.pipelines[0].pipeline_id - ); - console.log('RUNNING foundPipeline', foundPipeline?.pipeline_id); - console.log( - 'RUNNING selectedPreset', - selectedPreset?.pipelines[0].pipeline_id - ); + // console.log( + // 'RUNNING selectedPresetCopy', + // selectedPresetCopy?.pipelines[0].pipeline_id + // ); + // console.log('RUNNING foundPipeline', foundPipeline?.pipeline_id); + // console.log( + // 'RUNNING selectedPreset', + // selectedPreset?.pipelines[0].pipeline_id + // ); setProductionSetup((prevState) => { - console.log('setSelectedPipelineName - prevState:', prevState); + // console.log('setSelectedPipelineName - prevState:', prevState); const updatedPipelines = prevState?.production_settings.pipelines; if (!updatedPipelines) return; updatedPipelines[pipelineIndex].pipeline_name = pipelineName; @@ -265,16 +271,24 @@ export default function ProductionConfiguration({ params }: PageProps) { console.log( 'REFRESH RUNNING', params.id, - config.production_settings.pipelines[0].pipeline_id + config.production_settings + ? config.production_settings.pipelines[0].pipeline_id + : '' ); + if ( + config.production_settings?.pipelines[0].pipeline_id && + productionSetup?.production_settings?.pipelines[0].pipeline_id + ) { + return; + } // check if production has pipelines in use or control panels in use, if so update production const production = config.isActive ? config : checkProductionPipelines(config, pipelines); - console.log('REFRESH pipelines', pipelines); + // console.log('REFRESH pipelines', pipelines); console.log( 'PUT REQUEST:', - production.production_settings.pipelines[0].pipeline_id + production.production_settings?.pipelines[0].pipeline_id ); putProduction(production._id, production); setProductionSetup(production); @@ -391,7 +405,7 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updateProduction = (id: string, productionSetup: Production) => { - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(productionSetup); console.log( 'PUT REQUEST:', @@ -450,7 +464,7 @@ export default function ProductionConfiguration({ params }: PageProps) { ) } }; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedProduction); }); } @@ -516,7 +530,7 @@ export default function ProductionConfiguration({ params }: PageProps) { productionSetup: Production ) => { const updatedSetup = updateSetupItem(source, productionSetup); - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); console.log( 'PUT REQUEST:', @@ -535,7 +549,7 @@ export default function ProductionConfiguration({ params }: PageProps) { ...productionSetup, name: nameChange } as Production; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); console.log( 'PUT REQUEST:', @@ -595,7 +609,7 @@ export default function ProductionConfiguration({ params }: PageProps) { } } as Production; updatedSetup.production_settings.pipelines[0].multiviews = [multiview]; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); } @@ -640,6 +654,11 @@ export default function ProductionConfiguration({ params }: PageProps) { updatedSetup = await updatePipelinesWithSource(updatedSetup, source); setProductionSetup(updatedSetup); + // console.log('RUNNING'); + console.log( + 'PUT REQUEST:', + updatedSetup.production_settings.pipelines[0].pipeline_id + ); await putProduction(updatedSetup._id.toString(), updatedSetup); setAddSourceModal(false); @@ -702,7 +721,7 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); console.log( 'PUT REQUEST:', @@ -736,7 +755,7 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); console.log( 'PUT REQUEST:', @@ -859,7 +878,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(result); updateMultiview(sourceToAdd, result); console.log('REFRESH()'); @@ -923,7 +942,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setSelectedSourceRef(undefined); @@ -945,7 +964,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -981,7 +1000,7 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); } @@ -1028,7 +1047,7 @@ export default function ProductionConfiguration({ params }: PageProps) { if (!updatedSetup) return; updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then((result) => { if (!result) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -1198,7 +1217,7 @@ export default function ProductionConfiguration({ params }: PageProps) { ingestSourceId ); if (!updatedSetup) return; - console.log('RUNNING'); + // console.log('RUNNING'); setProductionSetup(updatedSetup); console.log( 'PUT REQUEST:', diff --git a/src/components/copyToClipboard/CopyItem.tsx b/src/components/copyToClipboard/CopyItem.tsx index fdbeca67..bd84fd3d 100644 --- a/src/components/copyToClipboard/CopyItem.tsx +++ b/src/components/copyToClipboard/CopyItem.tsx @@ -41,9 +41,16 @@ export const CopyItem = ({ if ('clipboard' in navigator) { navigator.clipboard .writeText(valueToCopy) - .then(() => handleCopyResult('SUCCESS')) - .catch(() => handleCopyResult('ERROR')); + .then(() => { + console.log('Copy went great:', valueToCopy); + handleCopyResult('SUCCESS'); + }) + .catch(() => { + console.log('Something went wrong copying:', valueToCopy); + handleCopyResult('ERROR'); + }); } else { + console.log('Clipboard API not available:', valueToCopy); handleCopyResult('ERROR'); } }; diff --git a/src/components/copyToClipboard/CopyToClipboard.tsx b/src/components/copyToClipboard/CopyToClipboard.tsx index 5ce47895..14a8fdb1 100644 --- a/src/components/copyToClipboard/CopyToClipboard.tsx +++ b/src/components/copyToClipboard/CopyToClipboard.tsx @@ -1,6 +1,6 @@ 'use client'; -import React from 'react'; +import React, { useEffect } from 'react'; import CopyItem from './CopyItem'; import { WhepMultiview } from '../../interfaces/whep'; import { SrtOutput } from '../../interfaces/pipeline'; @@ -15,6 +15,9 @@ interface ICopyToClipboard { } export const CopyToClipboard = ({ allSrtUrls }: ICopyToClipboard) => { + useEffect(() => { + console.log('allSrtUrls', allSrtUrls); + }, [allSrtUrls]); return (
{allSrtUrls.map(({ value, isMulti, viewer }) => ( diff --git a/src/components/dropDown/PipelineNameDropDown.tsx b/src/components/dropDown/PipelineNameDropDown.tsx index a236a215..8dd0b959 100644 --- a/src/components/dropDown/PipelineNameDropDown.tsx +++ b/src/components/dropDown/PipelineNameDropDown.tsx @@ -24,7 +24,9 @@ export default function PipelineNamesDropDown({ const [selected, setSelected] = useState(initial); useEffect(() => { const id = options?.find((o) => o.option === selected)?.id; - setSelectedPipelineName(pipelineIndex, selected, id); + if (selected && id) { + setSelectedPipelineName(pipelineIndex, selected, id); + } }, [selected]); const handleSetSelected = (option: string) => { diff --git a/src/components/productionsList/ProductionsListItem.tsx b/src/components/productionsList/ProductionsListItem.tsx index fc1b3b8f..11cc46f0 100644 --- a/src/components/productionsList/ProductionsListItem.tsx +++ b/src/components/productionsList/ProductionsListItem.tsx @@ -42,6 +42,10 @@ export function ProductionsListItem({ production }: ProductionListItemProps) { const handleStopProduction = async () => { stopProduction(production) .then((status) => { + console.log( + 'PUT REQUEST:', + production.production_settings?.pipelines[0].pipeline_id + ); putProduction(production._id.toString(), { ...production, isActive: false diff --git a/src/components/startProduction/StartProductionButton.tsx b/src/components/startProduction/StartProductionButton.tsx index ced6a2e4..74dc0e41 100644 --- a/src/components/startProduction/StartProductionButton.tsx +++ b/src/components/startProduction/StartProductionButton.tsx @@ -177,6 +177,10 @@ export function StartProductionButton({ stopProduction(production) .then((status) => { if (status.ok) { + console.log( + 'PUT REQUEST:', + production.production_settings?.pipelines[0].pipeline_id + ); putProduction(production._id.toString(), { ...production, isActive: false @@ -188,6 +192,10 @@ export function StartProductionButton({ }); } if (!status.ok) { + console.log( + 'PUT REQUEST:', + production.production_settings?.pipelines[0].pipeline_id + ); putProduction(production._id.toString(), { ...production, isActive: false diff --git a/src/hooks/productions.ts b/src/hooks/productions.ts index 33f44597..c6900cb5 100644 --- a/src/hooks/productions.ts +++ b/src/hooks/productions.ts @@ -28,7 +28,6 @@ export function useGetProduction() { }); if (response.ok) { const res = response.json(); - console.log('GET RESPONSE:', res); return res; } throw await response.text(); @@ -37,10 +36,6 @@ export function useGetProduction() { export function usePutProduction() { return async (id: string, production: Production): Promise => { - console.log( - 'PUT REQUEST:', - production.production_settings.pipelines[0].pipeline_id - ); const response = await fetch(`/api/manager/productions/${id}`, { method: 'PUT', headers: [['x-api-key', `Bearer ${API_SECRET_KEY}`]], From 95bf92da2f0a232cd65d8a8a8913e77a36967ea6 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 5 Nov 2024 10:57:50 +0100 Subject: [PATCH 04/15] fix: start/stop button not updating --- src/app/production/[id]/page.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index dc19b979..70a46bae 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -275,12 +275,6 @@ export default function ProductionConfiguration({ params }: PageProps) { ? config.production_settings.pipelines[0].pipeline_id : '' ); - if ( - config.production_settings?.pipelines[0].pipeline_id && - productionSetup?.production_settings?.pipelines[0].pipeline_id - ) { - return; - } // check if production has pipelines in use or control panels in use, if so update production const production = config.isActive ? config From e236f3a40456fe46a5ea5baa2fe8ad2737839338 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 5 Nov 2024 11:41:44 +0100 Subject: [PATCH 05/15] fix: pipeline ids deleted when setting outputs --- src/app/production/[id]/page.tsx | 15 ++++++--------- .../configureOutputModal/ConfigureOutputModal.tsx | 8 ++++++++ .../startProduction/ConfigureOutputButton.tsx | 1 - 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index 70a46bae..962bc2bc 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -224,20 +224,17 @@ export default function ProductionConfiguration({ params }: PageProps) { ); const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; + console.log('FOUND PIPELINE', foundPipeline); if (foundPipeline) { foundPipeline.outputs = []; foundPipeline.pipeline_name = pipelineName; + foundPipeline.pipeline_id = id; } + console.log( + 'SETTING SELECTED PRESET IN SET SELECTED PIPELINE NAME', + selectedPresetCopy?.pipelines.map((p) => p.pipeline_id) + ); setSelectedPreset(selectedPresetCopy); - // console.log( - // 'RUNNING selectedPresetCopy', - // selectedPresetCopy?.pipelines[0].pipeline_id - // ); - // console.log('RUNNING foundPipeline', foundPipeline?.pipeline_id); - // console.log( - // 'RUNNING selectedPreset', - // selectedPreset?.pipelines[0].pipeline_id - // ); setProductionSetup((prevState) => { // console.log('setSelectedPipelineName - prevState:', prevState); const updatedPipelines = prevState?.production_settings.pipelines; diff --git a/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx b/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx index 169b9d93..5b057d07 100644 --- a/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx +++ b/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx @@ -49,6 +49,10 @@ export function ConfigureOutputModal({ }, [preset]); const onSave = () => { + console.log( + 'pipeline Ids at start of save: ', + pipelines.map((p) => p.pipeline_id) + ); const locations = pipelines .map((p) => p.outputs?.map((o) => @@ -67,6 +71,10 @@ export function ConfigureOutputModal({ setCurrentError('Same : used for multiple streams'); return; } + console.log( + 'Pipeline Ids right before update prod outputs/end of save', + pipelines.map((p) => p.pipeline_id) + ); updatePreset({ ...preset, pipelines: pipelines }); onClose(); }; diff --git a/src/components/startProduction/ConfigureOutputButton.tsx b/src/components/startProduction/ConfigureOutputButton.tsx index 8bcf015a..30761801 100644 --- a/src/components/startProduction/ConfigureOutputButton.tsx +++ b/src/components/startProduction/ConfigureOutputButton.tsx @@ -6,7 +6,6 @@ import { Preset } from '../../interfaces/preset'; import { useTranslate } from '../../i18n/useTranslate'; import { Button } from '../button/Button'; import { ConfigureOutputModal } from '../modal/configureOutputModal/ConfigureOutputModal'; -import { PipelineSettings } from '../../interfaces/pipeline'; type ConfigureOutputButtonProps = { preset?: Preset; From cc4928b303bda551d0086da2b2db228e2d875ae4 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 5 Nov 2024 11:57:33 +0100 Subject: [PATCH 06/15] fix: remove redundant console.log --- src/app/production/[id]/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index 962bc2bc..05aa4110 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -224,7 +224,6 @@ export default function ProductionConfiguration({ params }: PageProps) { ); const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; - console.log('FOUND PIPELINE', foundPipeline); if (foundPipeline) { foundPipeline.outputs = []; foundPipeline.pipeline_name = pipelineName; From 7bb493ebe4c1807e589e8e09c7416e9908463282 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 5 Nov 2024 12:29:52 +0100 Subject: [PATCH 07/15] fix: keep output streams inbetween renders --- src/app/production/[id]/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index 05aa4110..bb3474f0 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -225,7 +225,7 @@ export default function ProductionConfiguration({ params }: PageProps) { const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; if (foundPipeline) { - foundPipeline.outputs = []; + foundPipeline.outputs = foundPipeline.outputs || []; foundPipeline.pipeline_name = pipelineName; foundPipeline.pipeline_id = id; } @@ -240,7 +240,8 @@ export default function ProductionConfiguration({ params }: PageProps) { if (!updatedPipelines) return; updatedPipelines[pipelineIndex].pipeline_name = pipelineName; updatedPipelines[pipelineIndex].pipeline_id = id; - updatedPipelines[pipelineIndex].outputs = []; + updatedPipelines[pipelineIndex].outputs = + prevState.production_settings.pipelines[pipelineIndex].outputs || []; console.log( 'PUT REQUEST:', prevState.production_settings.pipelines[0].pipeline_id From 8d1935e6392c264089290f4788e3eaf1bd7530ea Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 5 Nov 2024 12:41:09 +0100 Subject: [PATCH 08/15] fix: output logs --- src/app/production/[id]/page.tsx | 5 +++++ src/components/pipeline/PipelineCard.tsx | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index bb3474f0..c1450b29 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -225,6 +225,7 @@ export default function ProductionConfiguration({ params }: PageProps) { const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; if (foundPipeline) { + console.log('foundPipeline outputs: ', foundPipeline.outputs); foundPipeline.outputs = foundPipeline.outputs || []; foundPipeline.pipeline_name = pipelineName; foundPipeline.pipeline_id = id; @@ -238,6 +239,10 @@ export default function ProductionConfiguration({ params }: PageProps) { // console.log('setSelectedPipelineName - prevState:', prevState); const updatedPipelines = prevState?.production_settings.pipelines; if (!updatedPipelines) return; + console.log( + 'prevState outputs: ', + prevState.production_settings.pipelines[pipelineIndex].outputs + ); updatedPipelines[pipelineIndex].pipeline_name = pipelineName; updatedPipelines[pipelineIndex].pipeline_id = id; updatedPipelines[pipelineIndex].outputs = diff --git a/src/components/pipeline/PipelineCard.tsx b/src/components/pipeline/PipelineCard.tsx index cdea3c53..7e2c7189 100644 --- a/src/components/pipeline/PipelineCard.tsx +++ b/src/components/pipeline/PipelineCard.tsx @@ -19,10 +19,6 @@ export function PipelineCard({ pipelineId, isActive }: PipelineCardProps) { const SrtInfo = data?.status; - useEffect(() => { - console.log('SrtInfo', SrtInfo); - }, [SrtInfo]); - if (SrtInfo === undefined) { return null; } From 686d0bbde9c317d3e3ad4fb3ebb939ba6dae788b Mon Sep 17 00:00:00 2001 From: Saelmala Date: Thu, 7 Nov 2024 09:53:46 +0100 Subject: [PATCH 09/15] fix: create media/html errors --- .../renderingengine/renderingengine.ts | 176 +++++++++++++++--- src/api/manager/workflow.ts | 17 +- src/app/production/[id]/page.tsx | 3 - 3 files changed, 164 insertions(+), 32 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 3422758d..83f05804 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -49,11 +49,23 @@ export async function createPipelineHtmlSource( data: HTMLSource, source: SourceReference ) { + const payload = { + height: Number(data.height), + input_slot: Number(inputSlot), + url: data.url || '', + width: Number(data.width) + }; + + Log().info('CREATE HTML SOURCE PAYLOAD', payload); + try { const { production_settings } = production; - const htmlResults = []; for (let i = 0; i < production_settings.pipelines.length; i++) { + Log().info( + 'PIPELINE ID TO CREATE HTML SOURCE FOR: ', + production_settings.pipelines[i].pipeline_id + ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -65,21 +77,32 @@ export async function createPipelineHtmlSource( headers: { authorization: getAuthorizationHeader() }, - body: JSON.stringify({ - height: Number(data.height), - input_slot: Number(inputSlot), - url: data.url || '', - width: Number(data.width) - }) + body: JSON.stringify(payload) } ); + const text = await response.text(); if (response.ok) { - const text = await response.text(); - const jsonResponse = text ? JSON.parse(text) : {}; - htmlResults.push(jsonResponse); + if (text.trim().length > 0) { + Log().warn('Unexpected content for 201 response:', text); + } + Log().info('SUCCESSFUL CREATION OF HTML SOURCE'); + } else if (response.status === 400 || response.status === 404 || response.status === 500) { + Log().info("ERROR WHEN CREATING AN HTML SOURCE"); + try { + const errorResponse = JSON.parse(text); + Log().error('API error response:', errorResponse); + throw new Error( + `API error ${response.status}: ${errorResponse.message}` + ); + } catch (parseError) { + Log().error('Failed to parse error response as JSON:', text); + throw new Error(`API error ${response.status}: ${text}`); + } } else { - throw await response.json(); + Log().error(`Unexpected status code ${response.status} received`); + Log().error('Response body:', text); + throw new Error(`Unexpected response status: ${response.status}`); } } } catch (e) { @@ -308,11 +331,21 @@ export async function createPipelineMediaSource( data: MediaSource, source: SourceReference ) { + const payload = { + filename: data.filename, + input_slot: Number(inputSlot) + }; + try { const { production_settings } = production; - const mediaResults = []; + + Log().info('PAYLOAD CREATE MEDIA', payload); for (let i = 0; i < production_settings.pipelines.length; i++) { + Log().info( + 'CREATING MEDIA FOR PIPELINE ID: ', + production_settings.pipelines[i].pipeline_id + ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -324,18 +357,32 @@ export async function createPipelineMediaSource( headers: { authorization: getAuthorizationHeader() }, - body: JSON.stringify({ - filename: data.filename, - input_slot: Number(inputSlot) - }) + body: JSON.stringify(payload) } ); - if (response.ok) { - const text = await response.text(); - const jsonResponse = text ? JSON.parse(text) : {}; - mediaResults.push(jsonResponse); + const text = await response.text(); + + if (response.status === 201) { + if (text.trim().length > 0) { + Log().warn('Unexpected content for 201 response:', text); + } + Log().info('SUCCESSFULLY CREATED MEDIA SOURCE'); + } else if (response.status === 400 || response.status === 500) { + Log().info("ERROR WHEN CREATING A MEDIA SOURCE"); + try { + const errorResponse = JSON.parse(text); + Log().error('API error response:', errorResponse); + throw new Error( + `API error ${response.status}: ${errorResponse.message}` + ); + } catch (parseError) { + Log().error('Failed to parse error response as JSON:', text); + throw new Error(`API error ${response.status}: ${text}`); + } } else { - throw await response.json(); + Log().error(`Unexpected status code ${response.status} received`); + Log().error('Response body:', text); + throw new Error(`Unexpected response status: ${response.status}`); } } } catch (e) { @@ -520,7 +567,6 @@ export async function deleteMediaFromPipeline( export async function getPipelineRenderingEngine( pipelineUuid: string ): Promise { - console.log('getPipelineRenderingEngine', pipelineUuid); const response = await fetch( new URL( LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/renderingengine`, @@ -560,3 +606,89 @@ export async function getPipelineRenderingEngine( throw new Error(`Unexpected non-JSON response: ${responseText}`); } } + +export async function getPipelineRenderingEngineHtml( + pipelineUuid: string +): Promise { + const response = await fetch( + new URL( + LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/renderingengine/html`, + process.env.LIVE_URL + ), + { + method: 'GET', + headers: { + authorization: getAuthorizationHeader() + }, + next: { + revalidate: 0 + } + } + ); + + if (response.ok) { + try { + return await response.json(); + } catch (error) { + console.error('Failed to parse successful JSON response:', error); + throw new Error('Parsing error in successful response.'); + } + } + + const contentType = response.headers.get('content-type'); + const responseText = await response.text(); + + if (contentType && contentType.includes('application/json')) { + try { + throw JSON.parse(responseText); + } catch (error) { + console.error('Failed to parse JSON error response:', error); + throw new Error(`Failed to parse JSON error response: ${responseText}`); + } + } else { + throw new Error(`Unexpected non-JSON response: ${responseText}`); + } +} + +export async function getPipelineRenderingEngineMedia( + pipelineUuid: string +): Promise { + const response = await fetch( + new URL( + LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/renderingengine/media`, + process.env.LIVE_URL + ), + { + method: 'GET', + headers: { + authorization: getAuthorizationHeader() + }, + next: { + revalidate: 0 + } + } + ); + + if (response.ok) { + try { + return await response.json(); + } catch (error) { + console.error('Failed to parse successful JSON response:', error); + throw new Error('Parsing error in successful response.'); + } + } + + const contentType = response.headers.get('content-type'); + const responseText = await response.text(); + + if (contentType && contentType.includes('application/json')) { + try { + throw JSON.parse(responseText); + } catch (error) { + console.error('Failed to parse JSON error response:', error); + throw new Error(`Failed to parse JSON error response: ${responseText}`); + } + } else { + throw new Error(`Unexpected non-JSON response: ${responseText}`); + } +} diff --git a/src/api/manager/workflow.ts b/src/api/manager/workflow.ts index a9d7ca26..b73f634f 100644 --- a/src/api/manager/workflow.ts +++ b/src/api/manager/workflow.ts @@ -55,7 +55,8 @@ import { updatedMonitoringForProduction } from './job/syncMonitoring'; import { ObjectId } from 'mongodb'; import { MultiviewSettings } from '../../interfaces/multiview'; import { - getPipelineRenderingEngine, + getPipelineRenderingEngineHtml, + getPipelineRenderingEngineMedia, createPipelineHtmlSource, createPipelineMediaSource, deleteHtmlFromPipeline, @@ -342,12 +343,11 @@ export async function stopProduction( for (const pipeline of production.production_settings.pipelines) { const pipelineId = pipeline.pipeline_id; if (pipelineId) { - const pipelineRenderingEngine = await getPipelineRenderingEngine( - pipelineId - ); + const htmlSources = await getPipelineRenderingEngineHtml(pipelineId); + const mediaSources = await getPipelineRenderingEngineMedia(pipelineId); - const htmlSources = pipelineRenderingEngine.html; - const mediaSources = pipelineRenderingEngine.media; + Log().info('GET RENDERING ENGINE HTML SOURCES: ', htmlSources); + Log().info('GET RENDERING ENGINE MEDIA SOURCES: ', mediaSources); if (htmlSources.length > 0 && htmlSources) { for (const pipeline of production.production_settings.pipelines) { @@ -805,12 +805,15 @@ export async function startProduction( (source) => source.type === 'mediaplayer' ); + Log().info('HTML SOURCES IN START PRODUCTION: ', htmlSources); + Log().info('MEDIA SOURCES IN START PRODUCTION: ', mediaSources); + if (htmlSources.length > 0) { for (const htmlSource of htmlSources) { if (htmlSource.html_data) { const htmlData = { ...htmlSource.html_data, - url: htmlSource.html_data?.url || '', + url: htmlSource.html_data.url || '', input_slot: htmlSource.input_slot }; await createPipelineHtmlSource( diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index c1450b29..3f681fe6 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -70,7 +70,6 @@ import { useDeleteHtmlSource } from '../../../hooks/renderingEngine/useDeleteHtm import { useDeleteMediaSource } from '../../../hooks/renderingEngine/useDeleteMediaSource'; import { useCreateHtmlSource } from '../../../hooks/renderingEngine/useCreateHtmlSource'; import { useCreateMediaSource } from '../../../hooks/renderingEngine/useCreateMediaSource'; -import { useRenderingEngine } from '../../../hooks/renderingEngine/useRenderingEngine'; export default function ProductionConfiguration({ params }: PageProps) { const t = useTranslate(); @@ -146,7 +145,6 @@ export default function ProductionConfiguration({ params }: PageProps) { const [deleteMediaSource, deleteMediaLoading] = useDeleteMediaSource(); const [createHtmlSource, createHtmlLoading] = useCreateHtmlSource(); const [createMediaSource, createMediaLoading] = useCreateMediaSource(); - const [getRenderingEngine, renderingEngineLoading] = useRenderingEngine(); const { locked } = useContext(GlobalContext); @@ -1020,7 +1018,6 @@ export default function ProductionConfiguration({ params }: PageProps) { const pipelineId = productionSetup.production_settings.pipelines[i].pipeline_id; if (pipelineId) { - getRenderingEngine(pipelineId); if (selectedSourceRef.type === 'html') { await deleteHtmlSource( pipelineId, From 3d7cfd2fb3f87f0b83d481589d009bfc233d9dd0 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Thu, 7 Nov 2024 09:55:54 +0100 Subject: [PATCH 10/15] fix: linting --- .../pipelines/renderingengine/renderingengine.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 83f05804..13ec1204 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -87,8 +87,12 @@ export async function createPipelineHtmlSource( Log().warn('Unexpected content for 201 response:', text); } Log().info('SUCCESSFUL CREATION OF HTML SOURCE'); - } else if (response.status === 400 || response.status === 404 || response.status === 500) { - Log().info("ERROR WHEN CREATING AN HTML SOURCE"); + } else if ( + response.status === 400 || + response.status === 404 || + response.status === 500 + ) { + Log().info('ERROR WHEN CREATING AN HTML SOURCE'); try { const errorResponse = JSON.parse(text); Log().error('API error response:', errorResponse); @@ -368,7 +372,7 @@ export async function createPipelineMediaSource( } Log().info('SUCCESSFULLY CREATED MEDIA SOURCE'); } else if (response.status === 400 || response.status === 500) { - Log().info("ERROR WHEN CREATING A MEDIA SOURCE"); + Log().info('ERROR WHEN CREATING A MEDIA SOURCE'); try { const errorResponse = JSON.parse(text); Log().error('API error response:', errorResponse); From f38812e12821ff5b1055d12d1fa4dd84ecfe3304 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Fri, 8 Nov 2024 09:28:15 +0100 Subject: [PATCH 11/15] fix: more logs --- .../pipelines/renderingengine/renderingengine.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 13ec1204..d5eca40f 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -81,8 +81,11 @@ export async function createPipelineHtmlSource( } ); const text = await response.text(); + Log().info("RESPONSE CREATE HTML: ", response); + Log().info("RESPONSE.TEXT CREATE HTML: ", text); + Log().info("RESPONSE.STATUS CREATE HTML: ", response.status); - if (response.ok) { + if (response.status === 201) { if (text.trim().length > 0) { Log().warn('Unexpected content for 201 response:', text); } @@ -365,6 +368,9 @@ export async function createPipelineMediaSource( } ); const text = await response.text(); + Log().info("RESPONSE CREATE MEDIA: ", response); + Log().info("RESPONSE.TEXT CREATE MEDIA: ", text); + Log().info("RESPONSE.STATUS CREATE MEDIA: ", response.status); if (response.status === 201) { if (text.trim().length > 0) { From d60fdff32c603ad48009cb54a1e4c21023449ebf Mon Sep 17 00:00:00 2001 From: Saelmala Date: Fri, 8 Nov 2024 09:31:41 +0100 Subject: [PATCH 12/15] fix: prettier test fail --- .../pipelines/renderingengine/renderingengine.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index d5eca40f..74665bbb 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -81,9 +81,9 @@ export async function createPipelineHtmlSource( } ); const text = await response.text(); - Log().info("RESPONSE CREATE HTML: ", response); - Log().info("RESPONSE.TEXT CREATE HTML: ", text); - Log().info("RESPONSE.STATUS CREATE HTML: ", response.status); + Log().info('RESPONSE CREATE HTML: ', response); + Log().info('RESPONSE.TEXT CREATE HTML: ', text); + Log().info('RESPONSE.STATUS CREATE HTML: ', response.status); if (response.status === 201) { if (text.trim().length > 0) { @@ -368,9 +368,9 @@ export async function createPipelineMediaSource( } ); const text = await response.text(); - Log().info("RESPONSE CREATE MEDIA: ", response); - Log().info("RESPONSE.TEXT CREATE MEDIA: ", text); - Log().info("RESPONSE.STATUS CREATE MEDIA: ", response.status); + Log().info('RESPONSE CREATE MEDIA: ', response); + Log().info('RESPONSE.TEXT CREATE MEDIA: ', text); + Log().info('RESPONSE.STATUS CREATE MEDIA: ', response.status); if (response.status === 201) { if (text.trim().length > 0) { From b4e1ec3a7d46f024a6c607f99455d57138e80739 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Fri, 8 Nov 2024 12:50:24 +0100 Subject: [PATCH 13/15] fix: url logs --- .../pipelines/renderingengine/renderingengine.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 74665bbb..b7a672b5 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -66,6 +66,10 @@ export async function createPipelineHtmlSource( 'PIPELINE ID TO CREATE HTML SOURCE FOR: ', production_settings.pipelines[i].pipeline_id ); + Log().info( + 'Request URL:', + `${LIVE_BASE_API_PATH}/pipelines/${production_settings.pipelines[i].pipeline_id}/renderingengine/html` + ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -353,6 +357,10 @@ export async function createPipelineMediaSource( 'CREATING MEDIA FOR PIPELINE ID: ', production_settings.pipelines[i].pipeline_id ); + Log().info( + 'Request URL:', + `${LIVE_BASE_API_PATH}/pipelines/${production_settings.pipelines[i].pipeline_id}/renderingengine/media` + ); const response = await fetch( new URL( LIVE_BASE_API_PATH + From 6e055840412b416e23fb11f892c6369e069c8197 Mon Sep 17 00:00:00 2001 From: Saelmala Date: Mon, 11 Nov 2024 13:32:52 +0100 Subject: [PATCH 14/15] fix: moved logs, response handling --- .../renderingengine/renderingengine.ts | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index b7a672b5..9b087290 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -58,6 +58,13 @@ export async function createPipelineHtmlSource( Log().info('CREATE HTML SOURCE PAYLOAD', payload); + for (let i = 0; i < production.production_settings.pipelines.length; i++) { + Log().info( + 'Request URL:', + `${LIVE_BASE_API_PATH}/pipelines/${production.production_settings.pipelines[i].pipeline_id}/renderingengine/html` + ); + } + try { const { production_settings } = production; @@ -66,10 +73,6 @@ export async function createPipelineHtmlSource( 'PIPELINE ID TO CREATE HTML SOURCE FOR: ', production_settings.pipelines[i].pipeline_id ); - Log().info( - 'Request URL:', - `${LIVE_BASE_API_PATH}/pipelines/${production_settings.pipelines[i].pipeline_id}/renderingengine/html` - ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -305,9 +308,14 @@ export async function deleteHtmlFromPipeline( } } ); + Log().info('DELETE HTML RESPONSE', response); if (response.ok) { const text = await response.text(); - return text ? JSON.parse(text) : {}; + + if (text) { + return JSON.parse(text); + } + return; } throw await response.json(); } @@ -346,21 +354,23 @@ export async function createPipelineMediaSource( filename: data.filename, input_slot: Number(inputSlot) }; + Log().info('PAYLOAD CREATE MEDIA', payload); + + for (let i = 0; i < production.production_settings.pipelines.length; i++) { + Log().info( + 'Request URL:', + `${LIVE_BASE_API_PATH}/pipelines/${production.production_settings.pipelines[i].pipeline_id}/renderingengine/media` + ); + } try { const { production_settings } = production; - Log().info('PAYLOAD CREATE MEDIA', payload); - for (let i = 0; i < production_settings.pipelines.length; i++) { Log().info( 'CREATING MEDIA FOR PIPELINE ID: ', production_settings.pipelines[i].pipeline_id ); - Log().info( - 'Request URL:', - `${LIVE_BASE_API_PATH}/pipelines/${production_settings.pipelines[i].pipeline_id}/renderingengine/media` - ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -575,9 +585,14 @@ export async function deleteMediaFromPipeline( } } ); + Log().info('DELETE MEDIA RESPONSE', response); if (response.ok) { const text = await response.text(); - return text ? JSON.parse(text) : {}; + + if (text) { + return JSON.parse(text); + } + return; } throw await response.json(); } From c201fb87ac8053e7f97344a1bcb9a5f17277d74f Mon Sep 17 00:00:00 2001 From: Saelmala Date: Tue, 12 Nov 2024 09:15:59 +0100 Subject: [PATCH 15/15] fix: remove logs --- .../renderingengine/renderingengine.ts | 37 ------- src/api/manager/workflow.ts | 6 - src/app/production/[id]/page.tsx | 103 +----------------- src/components/copyToClipboard/CopyItem.tsx | 1 - .../copyToClipboard/CopyToClipboard.tsx | 3 - .../ConfigureOutputModal.tsx | 8 -- .../productionsList/ProductionsListItem.tsx | 4 - .../startProduction/StartProductionButton.tsx | 8 -- 8 files changed, 1 insertion(+), 169 deletions(-) diff --git a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts index 9b087290..c01c4b29 100644 --- a/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts +++ b/src/api/ateliereLive/pipelines/renderingengine/renderingengine.ts @@ -56,23 +56,10 @@ export async function createPipelineHtmlSource( width: Number(data.width) }; - Log().info('CREATE HTML SOURCE PAYLOAD', payload); - - for (let i = 0; i < production.production_settings.pipelines.length; i++) { - Log().info( - 'Request URL:', - `${LIVE_BASE_API_PATH}/pipelines/${production.production_settings.pipelines[i].pipeline_id}/renderingengine/html` - ); - } - try { const { production_settings } = production; for (let i = 0; i < production_settings.pipelines.length; i++) { - Log().info( - 'PIPELINE ID TO CREATE HTML SOURCE FOR: ', - production_settings.pipelines[i].pipeline_id - ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -88,21 +75,16 @@ export async function createPipelineHtmlSource( } ); const text = await response.text(); - Log().info('RESPONSE CREATE HTML: ', response); - Log().info('RESPONSE.TEXT CREATE HTML: ', text); - Log().info('RESPONSE.STATUS CREATE HTML: ', response.status); if (response.status === 201) { if (text.trim().length > 0) { Log().warn('Unexpected content for 201 response:', text); } - Log().info('SUCCESSFUL CREATION OF HTML SOURCE'); } else if ( response.status === 400 || response.status === 404 || response.status === 500 ) { - Log().info('ERROR WHEN CREATING AN HTML SOURCE'); try { const errorResponse = JSON.parse(text); Log().error('API error response:', errorResponse); @@ -308,7 +290,6 @@ export async function deleteHtmlFromPipeline( } } ); - Log().info('DELETE HTML RESPONSE', response); if (response.ok) { const text = await response.text(); @@ -354,23 +335,11 @@ export async function createPipelineMediaSource( filename: data.filename, input_slot: Number(inputSlot) }; - Log().info('PAYLOAD CREATE MEDIA', payload); - - for (let i = 0; i < production.production_settings.pipelines.length; i++) { - Log().info( - 'Request URL:', - `${LIVE_BASE_API_PATH}/pipelines/${production.production_settings.pipelines[i].pipeline_id}/renderingengine/media` - ); - } try { const { production_settings } = production; for (let i = 0; i < production_settings.pipelines.length; i++) { - Log().info( - 'CREATING MEDIA FOR PIPELINE ID: ', - production_settings.pipelines[i].pipeline_id - ); const response = await fetch( new URL( LIVE_BASE_API_PATH + @@ -386,17 +355,12 @@ export async function createPipelineMediaSource( } ); const text = await response.text(); - Log().info('RESPONSE CREATE MEDIA: ', response); - Log().info('RESPONSE.TEXT CREATE MEDIA: ', text); - Log().info('RESPONSE.STATUS CREATE MEDIA: ', response.status); if (response.status === 201) { if (text.trim().length > 0) { Log().warn('Unexpected content for 201 response:', text); } - Log().info('SUCCESSFULLY CREATED MEDIA SOURCE'); } else if (response.status === 400 || response.status === 500) { - Log().info('ERROR WHEN CREATING A MEDIA SOURCE'); try { const errorResponse = JSON.parse(text); Log().error('API error response:', errorResponse); @@ -585,7 +549,6 @@ export async function deleteMediaFromPipeline( } } ); - Log().info('DELETE MEDIA RESPONSE', response); if (response.ok) { const text = await response.text(); diff --git a/src/api/manager/workflow.ts b/src/api/manager/workflow.ts index b73f634f..9cc24355 100644 --- a/src/api/manager/workflow.ts +++ b/src/api/manager/workflow.ts @@ -346,9 +346,6 @@ export async function stopProduction( const htmlSources = await getPipelineRenderingEngineHtml(pipelineId); const mediaSources = await getPipelineRenderingEngineMedia(pipelineId); - Log().info('GET RENDERING ENGINE HTML SOURCES: ', htmlSources); - Log().info('GET RENDERING ENGINE MEDIA SOURCES: ', mediaSources); - if (htmlSources.length > 0 && htmlSources) { for (const pipeline of production.production_settings.pipelines) { for (const htmlSource of htmlSources) { @@ -805,9 +802,6 @@ export async function startProduction( (source) => source.type === 'mediaplayer' ); - Log().info('HTML SOURCES IN START PRODUCTION: ', htmlSources); - Log().info('MEDIA SOURCES IN START PRODUCTION: ', mediaSources); - if (htmlSources.length > 0) { for (const htmlSource of htmlSources) { if (htmlSource.html_data) { diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index 3f681fe6..b95c032d 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -161,31 +161,14 @@ export default function ProductionConfiguration({ params }: PageProps) { locked || !pipelinesAreSelected; - useEffect(() => { - console.log( - 'anything', - !!productionSetup?.production_settings.pipelines[0] - ); - console.log( - 'pipeline_id', - productionSetup?.production_settings?.pipelines[0].pipeline_id - ); - }, [productionSetup?.production_settings?.pipelines]); - useEffect(() => { refreshPipelines(); refreshControlPanels(); }, [productionSetup?.isActive]); const setSelectedControlPanel = (controlPanel: string[]) => { - // console.log('RUNNING'); setProductionSetup((prevState) => { - // console.log('setSelectedControlPanel - prevState:', prevState); if (!prevState) return; - console.log( - 'PUT REQUEST:', - prevState.production_settings.pipelines[0].pipeline_id - ); putProduction(prevState._id, { ...prevState, production_settings: { @@ -214,41 +197,21 @@ export default function ProductionConfiguration({ params }: PageProps) { pipelineName?: string, id?: string ) => { - console.log( - 'RUNNING setSelectedPipelineName', - pipelineIndex, - pipelineName, - id - ); const selectedPresetCopy = cloneDeep(selectedPreset); const foundPipeline = selectedPresetCopy?.pipelines[pipelineIndex]; if (foundPipeline) { - console.log('foundPipeline outputs: ', foundPipeline.outputs); foundPipeline.outputs = foundPipeline.outputs || []; foundPipeline.pipeline_name = pipelineName; foundPipeline.pipeline_id = id; } - console.log( - 'SETTING SELECTED PRESET IN SET SELECTED PIPELINE NAME', - selectedPresetCopy?.pipelines.map((p) => p.pipeline_id) - ); setSelectedPreset(selectedPresetCopy); setProductionSetup((prevState) => { - // console.log('setSelectedPipelineName - prevState:', prevState); const updatedPipelines = prevState?.production_settings.pipelines; if (!updatedPipelines) return; - console.log( - 'prevState outputs: ', - prevState.production_settings.pipelines[pipelineIndex].outputs - ); updatedPipelines[pipelineIndex].pipeline_name = pipelineName; updatedPipelines[pipelineIndex].pipeline_id = id; updatedPipelines[pipelineIndex].outputs = prevState.production_settings.pipelines[pipelineIndex].outputs || []; - console.log( - 'PUT REQUEST:', - prevState.production_settings.pipelines[0].pipeline_id - ); putProduction(prevState._id, { ...prevState, production_settings: { @@ -268,22 +231,10 @@ export default function ProductionConfiguration({ params }: PageProps) { const refreshProduction = () => { getProduction(params.id).then((config) => { - console.log( - 'REFRESH RUNNING', - params.id, - config.production_settings - ? config.production_settings.pipelines[0].pipeline_id - : '' - ); // check if production has pipelines in use or control panels in use, if so update production const production = config.isActive ? config : checkProductionPipelines(config, pipelines); - // console.log('REFRESH pipelines', pipelines); - console.log( - 'PUT REQUEST:', - production.production_settings?.pipelines[0].pipeline_id - ); putProduction(production._id, production); setProductionSetup(production); setConfigurationName(production.name); @@ -305,7 +256,6 @@ export default function ProductionConfiguration({ params }: PageProps) { }; useEffect(() => { - console.log('REFRESH()'); refreshProduction(); }, []); @@ -388,23 +338,13 @@ export default function ProductionConfiguration({ params }: PageProps) { ); } } - console.log( - 'PUT REQUEST:', - updatedPreset.production_settings.pipelines[0].pipeline_id - ); putProduction(productionSetup?._id.toString(), updatedPreset).then(() => { - console.log('REFRESH()'); refreshProduction(); }); }; const updateProduction = (id: string, productionSetup: Production) => { - // console.log('RUNNING'); setProductionSetup(productionSetup); - console.log( - 'PUT REQUEST:', - productionSetup.production_settings.pipelines[0].pipeline_id - ); putProduction(id, productionSetup); }; @@ -458,7 +398,6 @@ export default function ProductionConfiguration({ params }: PageProps) { ) } }; - // console.log('RUNNING'); setProductionSetup(updatedProduction); }); } @@ -524,12 +463,7 @@ export default function ProductionConfiguration({ params }: PageProps) { productionSetup: Production ) => { const updatedSetup = updateSetupItem(source, productionSetup); - // console.log('RUNNING'); setProductionSetup(updatedSetup); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0].pipeline_id - ); putProduction(updatedSetup._id.toString(), updatedSetup); updateMultiview(source, updatedSetup); }; @@ -543,12 +477,7 @@ export default function ProductionConfiguration({ params }: PageProps) { ...productionSetup, name: nameChange } as Production; - // console.log('RUNNING'); setProductionSetup(updatedSetup); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0].pipeline_id - ); putProduction(updatedSetup._id.toString(), updatedSetup); }; @@ -603,7 +532,6 @@ export default function ProductionConfiguration({ params }: PageProps) { } } as Production; updatedSetup.production_settings.pipelines[0].multiviews = [multiview]; - // console.log('RUNNING'); setProductionSetup(updatedSetup); } @@ -648,11 +576,6 @@ export default function ProductionConfiguration({ params }: PageProps) { updatedSetup = await updatePipelinesWithSource(updatedSetup, source); setProductionSetup(updatedSetup); - // console.log('RUNNING'); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0].pipeline_id - ); await putProduction(updatedSetup._id.toString(), updatedSetup); setAddSourceModal(false); @@ -715,14 +638,8 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; - // console.log('RUNNING'); setProductionSetup(updatedSetup); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0].pipeline_id - ); putProduction(updatedSetup._id.toString(), updatedSetup).then(() => { - console.log('REFRESH()'); refreshProduction(); }); @@ -749,14 +666,8 @@ export default function ProductionConfiguration({ params }: PageProps) { }; const updatedSetup = addSetupItem(sourceToAdd, productionSetup); if (!updatedSetup) return; - // console.log('RUNNING'); setProductionSetup(updatedSetup); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0].pipeline_id - ); putProduction(updatedSetup._id.toString(), updatedSetup).then(() => { - console.log('REFRESH()'); refreshProduction(); }); @@ -872,10 +783,8 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - // console.log('RUNNING'); setProductionSetup(result); updateMultiview(sourceToAdd, result); - console.log('REFRESH()'); refreshProduction(); setAddSourceModal(false); setSelectedSource(undefined); @@ -936,7 +845,6 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - // console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setSelectedSourceRef(undefined); @@ -958,7 +866,6 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - // console.log('RUNNING'); setProductionSetup(updatedSetup); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -994,7 +901,6 @@ export default function ProductionConfiguration({ params }: PageProps) { updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then( (result) => { if (!result) return; - // console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); } @@ -1040,7 +946,6 @@ export default function ProductionConfiguration({ params }: PageProps) { if (!updatedSetup) return; updateSourceInputSlotOnMultiviewLayouts(updatedSetup).then((result) => { if (!result) return; - // console.log('RUNNING'); setProductionSetup(result); updateMultiview(selectedSourceRef, result); setRemoveSourceModal(false); @@ -1124,7 +1029,6 @@ export default function ProductionConfiguration({ params }: PageProps) { /> { - console.log('REFRESH()'); refreshProduction(); }} production={productionSetup} @@ -1210,13 +1114,8 @@ export default function ProductionConfiguration({ params }: PageProps) { ingestSourceId ); if (!updatedSetup) return; - // console.log('RUNNING'); setProductionSetup(updatedSetup); - console.log( - 'PUT REQUEST:', - updatedSetup.production_settings.pipelines[0] - .pipeline_id - ); + putProduction( updatedSetup._id.toString(), updatedSetup diff --git a/src/components/copyToClipboard/CopyItem.tsx b/src/components/copyToClipboard/CopyItem.tsx index bd84fd3d..cc5f5475 100644 --- a/src/components/copyToClipboard/CopyItem.tsx +++ b/src/components/copyToClipboard/CopyItem.tsx @@ -42,7 +42,6 @@ export const CopyItem = ({ navigator.clipboard .writeText(valueToCopy) .then(() => { - console.log('Copy went great:', valueToCopy); handleCopyResult('SUCCESS'); }) .catch(() => { diff --git a/src/components/copyToClipboard/CopyToClipboard.tsx b/src/components/copyToClipboard/CopyToClipboard.tsx index 14a8fdb1..855c134d 100644 --- a/src/components/copyToClipboard/CopyToClipboard.tsx +++ b/src/components/copyToClipboard/CopyToClipboard.tsx @@ -15,9 +15,6 @@ interface ICopyToClipboard { } export const CopyToClipboard = ({ allSrtUrls }: ICopyToClipboard) => { - useEffect(() => { - console.log('allSrtUrls', allSrtUrls); - }, [allSrtUrls]); return (
{allSrtUrls.map(({ value, isMulti, viewer }) => ( diff --git a/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx b/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx index 5b057d07..169b9d93 100644 --- a/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx +++ b/src/components/modal/configureOutputModal/ConfigureOutputModal.tsx @@ -49,10 +49,6 @@ export function ConfigureOutputModal({ }, [preset]); const onSave = () => { - console.log( - 'pipeline Ids at start of save: ', - pipelines.map((p) => p.pipeline_id) - ); const locations = pipelines .map((p) => p.outputs?.map((o) => @@ -71,10 +67,6 @@ export function ConfigureOutputModal({ setCurrentError('Same : used for multiple streams'); return; } - console.log( - 'Pipeline Ids right before update prod outputs/end of save', - pipelines.map((p) => p.pipeline_id) - ); updatePreset({ ...preset, pipelines: pipelines }); onClose(); }; diff --git a/src/components/productionsList/ProductionsListItem.tsx b/src/components/productionsList/ProductionsListItem.tsx index 11cc46f0..fc1b3b8f 100644 --- a/src/components/productionsList/ProductionsListItem.tsx +++ b/src/components/productionsList/ProductionsListItem.tsx @@ -42,10 +42,6 @@ export function ProductionsListItem({ production }: ProductionListItemProps) { const handleStopProduction = async () => { stopProduction(production) .then((status) => { - console.log( - 'PUT REQUEST:', - production.production_settings?.pipelines[0].pipeline_id - ); putProduction(production._id.toString(), { ...production, isActive: false diff --git a/src/components/startProduction/StartProductionButton.tsx b/src/components/startProduction/StartProductionButton.tsx index 74dc0e41..ced6a2e4 100644 --- a/src/components/startProduction/StartProductionButton.tsx +++ b/src/components/startProduction/StartProductionButton.tsx @@ -177,10 +177,6 @@ export function StartProductionButton({ stopProduction(production) .then((status) => { if (status.ok) { - console.log( - 'PUT REQUEST:', - production.production_settings?.pipelines[0].pipeline_id - ); putProduction(production._id.toString(), { ...production, isActive: false @@ -192,10 +188,6 @@ export function StartProductionButton({ }); } if (!status.ok) { - console.log( - 'PUT REQUEST:', - production.production_settings?.pipelines[0].pipeline_id - ); putProduction(production._id.toString(), { ...production, isActive: false