Skip to content

Conversation

nytamin
Copy link
Member

@nytamin nytamin commented Aug 28, 2025

About the Contributor

This pull request is posted on behalf of the NRK.

Type of Contribution

This is a: BREAKING CHANGE to the blueprint-integration interface.

Current Behavior

Use case:

We (NRK) need to trigger a TSR Action from blueprints at the time a user does a "Reset Rundown".
The problem is that neither one of the blueprints onRundownActivate nor onRundownDeactivate hooks are called upon a "Reset Rundown".

New Behavior

This PR does two things:

  • Changes the algorithm for a "Reset Rundown" so that it always run activateRundownPlaylist (which does a reset internally)
  • Removes the argument wasActive from onRundownActivate?: (context: IRundownActivationContext, wasActive: boolean) => Promise<void> (this is a BREAKING CHANGE) and instead adds previousState and currentState to IRundownActivationContext

This allows our blueprints to trigger our TSR Action from onRundownActivate

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

This PR affects the blueprints-integration interface.
This PR potentially affects the Reset Rundown method.

Time Frame

We've merged this into our local R52 branch, we would like to get this merged into the in-development release.

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

…rentState in RundownActivationContext. Also changed the algorithm in handleResetRundownPlaylist, so that activateRundownPlaylist always runs

This is to provide better context for blueprints, so that they can determine if a RundownPlaylist is being Activated from idle, from Rehersal or a Reset
@nytamin nytamin requested a review from a team as a code owner August 28, 2025 11:26
// Only update the timeline if this is the active playlist
await updateTimeline(context, playoutModel)
}
await activateRundownPlaylist(context, playoutModel, data.activate !== 'active', true) // Activate rundown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be a change in behaviour; if activate is undefined then activateRundownPlaylist will now be called, when it wasnt previously.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as I explained under "New behavior" this is my intent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/user-attachments/assets/988ee625-7d60-4ecc-a0e6-274c346e5831
That causes the playlist to be activated to rehearsal during a 'normal' reset of the rundown

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having talked to @Julusian the behavior is now closer to how it was originally, with only resetRundownPlaylist being called if the playlist is inactive.

@nytamin nytamin requested a review from Julusian September 8, 2025 12:05
# Conflicts:
#	packages/job-worker/src/playout/activePlaylistActions.ts
#	packages/job-worker/src/playout/activePlaylistJobs.ts
#	packages/job-worker/src/playout/lib.ts
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Member

@Julusian Julusian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a linter and unit test failure, both look to be quick fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants