Skip to content

Commit 5e53676

Browse files
committed
chore: improve code comments around the added logging
1 parent 96993d0 commit 5e53676

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

packages/job-worker/src/ingest/commit.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,13 @@ export async function CommitIngestOperation(
178178
// Ensure any adlibbed parts are updated to follow the segmentId of the previous part
179179
await updateSegmentIdsForAdlibbedPartInstances(context, ingestModel, beforePartMap)
180180

181+
// TODO: This whole section can probably be removed later, it's really unneccessary in the grand scheme of
182+
// things, it's here only to debug some problems
181183
if (data.renamedSegments && data.renamedSegments.size > 0) {
182184
logger.verbose(`Renamed segments: ${JSON.stringify(Array.from(data.renamedSegments.entries()))}`)
183185
}
186+
// End of temporary section
187+
184188
// ensure instances have matching segmentIds with the parts
185189
await updatePartInstancesSegmentIds(context, ingestModel, data.renamedSegments, beforePartMap)
186190

packages/job-worker/src/ingest/lock.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ export interface CommitIngestData {
2222
removedSegmentIds: SegmentId[]
2323
/**
2424
* Segments that had their ids changed. This helps then be orphaned in the correct place
25-
* eg, whole segment is renamed and middle part deleted
26-
* Note: Only supported for MOS, not 'normal' ingest operations
25+
* eg, whole segment is renamed and middle part deleted.
26+
*
27+
* Maps fromSegmentId to toSegmentId.
28+
*
29+
* _Note: Only supported for MOS, not 'normal' ingest operations_
2730
*/
2831
renamedSegments: Map<SegmentId, SegmentId> | null
2932

packages/job-worker/src/playout/adlibJobs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ export async function handleDisableNextPiece(context: JobContext, data: DisableN
438438

439439
return sortedPieces.find((piece) => {
440440
return (
441+
piece.pieceInstance.piece.enable.start !== 'now' &&
441442
piece.pieceInstance.piece.enable.start >= nowInPart &&
442443
((!data.undo && !piece.pieceInstance.disabled) || (data.undo && piece.pieceInstance.disabled))
443444
)

packages/job-worker/src/playout/infinites.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ export function getPieceInstancesForPart(
332332

333333
playingSegment = playingRundown.getSegment(playingPartInstance.partInstance.segmentId)
334334
if (!playingSegment) {
335+
// Double check that there are no parts using the old segment ids:
336+
// TODO: This whole section can probably be removed later, it's really unneccessary in the grand scheme of
337+
// things, it's here only to debug some problems
335338
const rundownId = playingRundown.rundown._id
336339
context.directCollections.Segments.findFetch({
337340
rundownId: rundownId,
@@ -344,6 +347,7 @@ export function getPieceInstancesForPart(
344347
)
345348
})
346349
.catch((e) => logger.error(e))
350+
// End of temporary section
347351

348352
throw new Error(
349353
`Segment "${playingPartInstance.partInstance.segmentId}" in Rundown "${

0 commit comments

Comments
 (0)