Skip to content

Commit c9a9736

Browse files
committed
feat: support external ID lookup for parts in playout model
1 parent a26eb77 commit c9a9736

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/job-worker/src/playout/model/implementation/PlayoutSegmentModelImpl.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ReadonlyDeep } from 'type-fest'
33
import { DBSegment, SegmentOrphanedReason } from '@sofie-automation/corelib/dist/dataModel/Segment'
44
import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part'
55
import { PlayoutSegmentModel } from '../PlayoutSegmentModel.js'
6+
import { unprotectString } from '@sofie-automation/corelib/dist/protectedString.js'
67

78
export class PlayoutSegmentModelImpl implements PlayoutSegmentModel {
89
readonly #segment: DBSegment
@@ -20,7 +21,7 @@ export class PlayoutSegmentModelImpl implements PlayoutSegmentModel {
2021
}
2122

2223
getPart(id: PartId): ReadonlyDeep<DBPart> | undefined {
23-
return this.parts.find((part) => part._id === id)
24+
return this.parts.find((part) => part._id === id || part.externalId === unprotectString(id))
2425
}
2526

2627
getPartIds(): PartId[] {

0 commit comments

Comments
 (0)