Skip to content

Commit 98ea62e

Browse files
committed
feat: reheasal time
1 parent ff3c354 commit 98ea62e

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,17 @@ export interface PlayoutModel extends PlayoutModelReadonly, StudioPlayoutModelBa
317317
*/
318318
setHoldState(newState: RundownHoldState): void
319319

320+
/**
321+
* Set the rehearsal start time for the RundownPlaylist
322+
* @param time The rehearsal start timestamp
323+
*/
324+
setPlaylistRehearsalStartTime(time: number): void
325+
326+
/**
327+
* Clear the rehearsal start time for the RundownPlaylist
328+
*/
329+
clearPlaylistRehearsalStartTime(): void
330+
320331
/**
321332
* Store the persistent results of the AB playback resolving
322333
* @param assignedAbSessions The applied AB sessions

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
519519
}
520520

521521
this.clearSelectedPartInstances()
522+
this.playlistImpl.rehearsal = false
523+
this.clearPlaylistRehearsalStartTime()
522524
this.playlistImpl.quickLoop = this.quickLoopService.getUpdatedPropsByClearingMarkers()
523525

524526
this.#playlistHasChanged = true
@@ -727,6 +729,18 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
727729
this.#playlistHasChanged = true
728730
}
729731

732+
setPlaylistRehearsalStartTime(time: number): void {
733+
this.playlistImpl.timing.rehearsalStartTime = time
734+
735+
this.#playlistHasChanged = true
736+
}
737+
738+
clearPlaylistRehearsalStartTime(): void {
739+
this.playlistImpl.timing.rehearsalStartTime = undefined
740+
741+
this.#playlistHasChanged = true
742+
}
743+
730744
setAbResolvingState(
731745
assignedAbSessions: Record<string, ABSessionAssignments>,
732746
trackedAbSessions: ABSessionInfo[]

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,16 @@ export async function performTakeToNextedPart(
209209
takePartInstance.setPlannedStartedPlayback(undefined)
210210
takePartInstance.setPlannedStoppedPlayback(undefined)
211211

212-
// it is only a first take if the Playlist has no startedPlayback and the taken PartInstance is not untimed
213-
const isFirstTake = !playoutModel.playlist.startedPlayback && !takePartInstance.partInstance.part.untimed
212+
// Check if this is the first take:
213+
const firstPartRank = playoutModel.nextPartInstance.partInstance.part._rank
214+
const firstSegmentRank =
215+
playoutModel.findSegment(playoutModel.nextPartInstance.partInstance.segmentId)?.segment._rank || 0
216+
const isFirstTake = firstPartRank === 0 && firstSegmentRank === 0
217+
218+
if (isFirstTake && playoutModel.playlist.rehearsal) {
219+
// If this is the first take and we are in rehearsal, we need to set the rehearsal start time
220+
playoutModel.setPlaylistRehearsalStartTime(getCurrentTime())
221+
}
214222

215223
clearQueuedSegmentId(playoutModel, takePartInstance.partInstance, playoutModel.playlist.nextPartInfo)
216224

@@ -441,6 +449,7 @@ async function afterTakeUpdateTimingsAndEvents(
441449
: undefined
442450

443451
if (isFirstTake && takeRundown) {
452+
console.log('This is first take')
444453
if (blueprint.blueprint.onRundownFirstTake) {
445454
const span = context.startSpan('blueprint.onRundownFirstTake')
446455
try {

packages/webui/src/client/styles/rundownView.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ body.no-overflow {
305305
&.playback-started {
306306
display: inline-block;
307307
width: 25%;
308+
margin-left: 10px;
308309
}
309310

310311
&.left {

packages/webui/src/client/ui/RundownView/RundownTiming/PlaylistEndTiming.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export function PlaylistEndTiming({
7676
expectedEnd ? (
7777
!rundownPlaylist.startedPlayback ? (
7878
<span className="timing-clock plan-end visual-last-child" role="timer">
79-
{!hidePlannedEndLabel && <span className="timing-clock-label right">{endLabel ?? t('Planned End')}</span>}
79+
{!hidePlannedEndLabel && (
80+
<span className="timing-clock-label right">
81+
{endLabel ?? (!rundownPlaylist.rehearsal ? t('Planned End') : t('Rehearsal End'))}
82+
</span>
83+
)}
8084
<Moment interval={0} format="HH:mm:ss" date={expectedEnd} />
8185
</span>
8286
) : (

packages/webui/src/client/ui/RundownView/RundownTiming/PlaylistStartTiming.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export function PlaylistStartTiming({
4141
</span>
4242
) : playlistExpectedStart ? (
4343
<span className="timing-clock plan-start left" role="timer">
44-
<span className="timing-clock-label left">{plannedStartText || t('Planned Start')}</span>
44+
<span className="timing-clock-label left">
45+
{plannedStartText || !rundownPlaylist.rehearsal ? t('Planned Start') : t('Rehearsal Start')}
46+
</span>
4547
<Moment interval={0} format="HH:mm:ss" date={playlistExpectedStart} />
4648
</span>
4749
) : playlistExpectedEnd && playlistExpectedDuration ? (

0 commit comments

Comments
 (0)