diff --git a/src/api/manager/productions.ts b/src/api/manager/productions.ts index 1d923a61..22713bb2 100644 --- a/src/api/manager/productions.ts +++ b/src/api/manager/productions.ts @@ -104,8 +104,8 @@ function deleteMonitoring(db: Db, productionId: string) { export async function getProductionPipelineSourceAlignment( productionId: string, pipelineId: string, - ingestName: string, - ingestSourceName: string + ingestSourceName: string, + ingestName: string ) { const production = await getProduction(productionId); diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index ff51f3dc..93890279 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -134,6 +134,8 @@ export default function ProductionConfiguration({ params }: PageProps) { const [updateStream, loading] = useUpdateStream(); + const [getIngestSourceId] = useIngestSourceId(); + const putProductionPipelineSourceAlignmentAndLatency = usePutProductionPipelineSourceAlignmentAndLatency(); @@ -351,7 +353,6 @@ export default function ProductionConfiguration({ params }: PageProps) { const handleSetPipelineSourceSettings = async ( source: ISource, - sourceId: number, data: { pipeline_uuid: string; stream_uuid: string; @@ -411,6 +412,10 @@ export default function ProductionConfiguration({ params }: PageProps) { const sourceToDeleteFrom = productionSetup.sources.find((source) => source.stream_uuids?.includes(streamUuids[0]) ); + const sourceId = await getIngestSourceId( + source.ingest_name, + source.ingest_source_name + ); deleteStream(streamUuids, productionSetup, sourceId) .then(() => { delete sourceToDeleteFrom?.stream_uuids; diff --git a/src/components/modal/ConfigureAlignmentLatencyModal.tsx b/src/components/modal/ConfigureAlignmentLatencyModal.tsx index e65d508e..c0e9fc03 100644 --- a/src/components/modal/ConfigureAlignmentLatencyModal.tsx +++ b/src/components/modal/ConfigureAlignmentLatencyModal.tsx @@ -25,7 +25,6 @@ type ConfigureAlignmentModalProps = { onAbort: () => void; onConfirm: ( source: ISource, - sourceId: number, data: { pipeline_uuid: string; stream_uuid: string; @@ -67,7 +66,6 @@ export function ConfigureAlignmentLatencyModal({ const [alignments, setAlignments] = useState({}); const [latencies, setLatencies] = useState({}); const previousLatenciesRef = useRef({}); - const [sourceId, setSourceId] = useState(0); const [showRestartStreamModal, setShowRestartStreamModal] = useState(false); const [inputErrors, setInputErrors] = useState>({}); @@ -98,17 +96,6 @@ export function ConfigureAlignmentLatencyModal({ } }, [pipelinesAreSelected, latencies, alignments]); - useEffect(() => { - const fetchSourceId = async () => { - const id = await getIngestSourceId( - source.ingest_name, - source.ingest_source_name - ); - setSourceId(id); - }; - fetchSourceId(); - }, [source]); - useEffect(() => { const fetchStreams = async () => { try { @@ -221,14 +208,13 @@ export function ConfigureAlignmentLatencyModal({ if (shouldRestart) { onConfirm( source, - sourceId, alignmentData, true, sourceStreams.map((stream) => stream.stream_uuid) ); handleCloseModal(); } else { - onConfirm(source, sourceId, alignmentData); + onConfirm(source, alignmentData); if (!latenciesChanged) { handleCloseModal(); } @@ -250,7 +236,7 @@ export function ConfigureAlignmentLatencyModal({ setInputErrors({}); }); - onConfirm(source, sourceId, alignmentData); + onConfirm(source, alignmentData); handleCloseModal(); } }; diff --git a/src/components/sourceCard/SourceCard.tsx b/src/components/sourceCard/SourceCard.tsx index ae89ae73..15911c50 100644 --- a/src/components/sourceCard/SourceCard.tsx +++ b/src/components/sourceCard/SourceCard.tsx @@ -18,7 +18,6 @@ type SourceCardProps = { onSelectingText: (bool: boolean) => void; onConfirm: ( source: ISource, - sourceId: number, data: { pipeline_uuid: string; stream_uuid: string; diff --git a/src/components/sourceCards/SourceCards.tsx b/src/components/sourceCards/SourceCards.tsx index 922b5c2d..cd2901a3 100644 --- a/src/components/sourceCards/SourceCards.tsx +++ b/src/components/sourceCards/SourceCards.tsx @@ -25,7 +25,6 @@ export default function SourceCards({ onSourceRemoval: (source: SourceReference, ingestSource?: ISource) => void; onConfirm: ( source: ISource, - sourceId: number, data: { pipeline_uuid: string; stream_uuid: string;