Skip to content

Commit 711c07a

Browse files
committed
fix: nocommits
1 parent 615cd1e commit 711c07a

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ async function writeUpdatedExpectedPackages(
154154
_id: doc._id,
155155
ingestSources: {
156156
// This is pretty messy, but we need to make sure that we don't add the same source twice
157-
// nocommit - does this work?
158157
$not: {
159-
elemMatch: matchSource,
158+
$elemMatch: matchSource,
160159
},
161160
},
162161
},
@@ -208,7 +207,6 @@ export async function updateExpectedPackagesForBucketAdLibPiece(
208207
await writeUpdatedExpectedPackages(context, adlib.bucketId, documentsToSave, {
209208
fromPieceType: ExpectedPackageDBType.BUCKET_ADLIB,
210209
pieceId: adlib._id,
211-
// nocommit - does this work?
212210
})
213211
}
214212

@@ -221,7 +219,6 @@ export async function updateExpectedPackagesForBucketAdLibAction(
221219
await writeUpdatedExpectedPackages(context, action.bucketId, documentsToSave, {
222220
fromPieceType: ExpectedPackageDBType.BUCKET_ADLIB_ACTION,
223221
pieceId: action._id,
224-
// nocommit - does this work?
225222
})
226223
}
227224

@@ -236,14 +233,7 @@ export async function cleanUpExpectedPackagesForBucketAdLibs(
236233
{
237234
studioId: context.studioId,
238235
bucketId: bucketId,
239-
ingestSources: {
240-
$elemMatch: {
241-
fromPieceType: {
242-
$in: [ExpectedPackageDBType.BUCKET_ADLIB, ExpectedPackageDBType.BUCKET_ADLIB_ACTION],
243-
},
244-
pieceId: { $in: adLibIds },
245-
},
246-
},
236+
// Note: this could have the ingestSources match, but that feels excessive as the $pull performs the same check
247237
},
248238
{
249239
$pull: {
@@ -252,7 +242,7 @@ export async function cleanUpExpectedPackagesForBucketAdLibs(
252242
$in: [ExpectedPackageDBType.BUCKET_ADLIB, ExpectedPackageDBType.BUCKET_ADLIB_ACTION],
253243
},
254244
pieceId: { $in: adLibIds },
255-
} as any, // nocommit - can we avoid this? Does this query even work?
245+
} as any, // This cast isn't nice, but is needed for some reason
256246
},
257247
}
258248
)

packages/job-worker/src/ingest/model/implementation/SaveIngestModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ async function writeExpectedPackagesChangesForRundown(
152152
},
153153
})
154154
} else {
155-
// nocommit - perform some diffing?
156155
// Document already exists, perform an update to preserve other fields
156+
// Future: would it be beneficial to perform some diffing to only update the field if it has changed?
157157
ops.push({
158158
updateOne: {
159159
filter: { _id: doc._id },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export async function handleRestorePlaylistSnapshot(
410410

411411
// Generate a unique id for the package.
412412
// This is done differently to ensure we don't have id collisions that the documents arent expecting
413-
// nocommit - maybe this should do the work to generate in the new deduplicated form?
413+
// Note: maybe this should do the work to generate in the new deduplicated form, but that likely has no benefit
414414
let packageOwnerId: string
415415
const ownerPieceType = source.fromPieceType
416416
switch (source.fromPieceType) {

0 commit comments

Comments
 (0)