Skip to content

Commit 2c65a0b

Browse files
author
Mint de Wit
committed
chore: expose methods correctly and consistently
1 parent a5c8283 commit 2c65a0b

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

packages/blueprints-integration/src/context/onSetAsNextContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ export interface IOnSetAsNextContext extends IShowStyleUserContext, IEventContex
7676
* Multiple calls of this inside one call to `onSetAsNext` will replace earlier calls.
7777
* @returns Whether a new Part was found using the provided offset
7878
*/
79-
moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickLoop: boolean): Promise<boolean>
79+
moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickLoop?: boolean): Promise<boolean>
8080
}

packages/job-worker/src/playout/model/PlayoutModel.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ export interface PlayoutModelReadonly extends StudioPlayoutModelBaseReadonly {
175175
*/
176176
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[]
177177

178+
/**
179+
* Returns any segmentId's that are found between 2 quickloop markers, none will be returned if
180+
* the end is before the start.
181+
* @param start A quickloop marker
182+
* @param end A quickloop marker
183+
*/
184+
getPartsBetweenQuickLoopMarker(
185+
start: QuickLoopMarker,
186+
end: QuickLoopMarker
187+
): { parts: PartId[]; segments: SegmentId[] }
188+
178189
/**
179190
* Search for a PieceInstance in the RundownPlaylist
180191
* @param id Id of the PieceInstance

packages/job-worker/src/playout/model/implementation/PlayoutModelImpl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ export class PlayoutModelReadonlyImpl implements PlayoutModelReadonly {
243243
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[] {
244244
return this.quickLoopService.getSegmentsBetweenMarkers(start, end)
245245
}
246+
getPartsBetweenQuickLoopMarker(
247+
start: QuickLoopMarker,
248+
end: QuickLoopMarker
249+
): { parts: PartId[]; segments: SegmentId[] } {
250+
return this.quickLoopService.getPartsBetweenMarkers(start, end)
251+
}
246252

247253
#isMultiGatewayMode: boolean | undefined = undefined
248254
public get isMultiGatewayMode(): boolean {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { sortPartsInSortedSegments } from '@sofie-automation/corelib/dist/playou
66
import { logger } from '../logging'
77
import { SegmentOrphanedReason } from '@sofie-automation/corelib/dist/dataModel/Segment'
88
import { ReadonlyDeep } from 'type-fest'
9-
import { QuickLoopService } from './model/services/QuickLoopService'
109

1110
export function selectNewPartWithOffsets(
1211
_context: JobContext,
@@ -29,9 +28,8 @@ export function selectNewPartWithOffsets(
2928
let rawParts = playoutModel.getAllOrderedParts()
3029
let allowWrap = false // whether we should wrap to the first part if the curIndex + delta exceeds the total number of parts
3130

32-
const quickLoopService = new QuickLoopService(_context, playoutModel)
3331
if (!ignoreQuickLoop && playlist.quickLoop?.start && playlist.quickLoop.end) {
34-
const partsInQuickloop = quickLoopService.getPartsBetweenMarkers(
32+
const partsInQuickloop = playoutModel.getPartsBetweenQuickLoopMarker(
3533
playlist.quickLoop.start,
3634
playlist.quickLoop.end
3735
)

0 commit comments

Comments
 (0)