Skip to content

Commit b065dd0

Browse files
committed
feat: option to disable HOLD
1 parent 3a526b7 commit b065dd0

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

packages/corelib/src/dataModel/Studio.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ export interface IStudioSettings {
8888
* Default: 3000
8989
*/
9090
fallbackPartDuration?: number
91+
92+
/**
93+
* Whether to allow hold operations for Rundowns in this Studio
94+
* When disabled, any action-triggers that would normally trigger a hold operation will be silently ignored
95+
* This should only block entering hold, to ensure Sofie doesn't get stuck if it somehow gets into hold
96+
*/
97+
allowHold?: boolean
9198
}
9299

93100
export type StudioLight = Omit<DBStudio, 'mappingsWithOverrides' | 'blueprintConfigWithOverrides'>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ import { ActivateHoldProps, DeactivateHoldProps } from '@sofie-automation/coreli
55
import { JobContext } from '../jobs'
66
import { runJobWithPlayoutModel } from './lock'
77
import { updateTimeline } from './timeline/generate'
8+
import { logger } from '../logging'
89

910
/**
1011
* Activate Hold
1112
*/
1213
export async function handleActivateHold(context: JobContext, data: ActivateHoldProps): Promise<void> {
14+
if (!context.studio.settings.allowHold) {
15+
// Hold isn't allowed, making this a noop
16+
logger.debug(`Hold isn't allowed, skipping`)
17+
return
18+
}
19+
1320
return runJobWithPlayoutModel(
1421
context,
1522
data,
@@ -59,6 +66,8 @@ export async function handleActivateHold(context: JobContext, data: ActivateHold
5966
* Deactivate Hold
6067
*/
6168
export async function handleDeactivateHold(context: JobContext, data: DeactivateHoldProps): Promise<void> {
69+
// This should be possible even when hold is not allowed, as it is a way to get out of a stuck state
70+
6271
return runJobWithPlayoutModel(
6372
context,
6473
data,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ const RundownHeader = withTranslation()(
10501050
{this.props.playlist.activationId ? (
10511051
<MenuItem onClick={(e) => this.take(e)}>{t('Take')}</MenuItem>
10521052
) : null}
1053-
{this.props.playlist.activationId ? (
1053+
{this.props.studio.settings.allowHold && this.props.playlist.activationId ? (
10541054
<MenuItem onClick={(e) => this.hold(e)}>{t('Hold')}</MenuItem>
10551055
) : null}
10561056
{this.props.playlist.activationId && canClearQuickLoop ? (

packages/webui/src/client/ui/Settings/Studio/Generic.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,20 @@ export const StudioGenericProperties = withTranslation()(
296296
</div>
297297
</label>
298298

299+
<label className="field">
300+
<LabelActual label={t('Allow HOLD mode')} />
301+
<EditAttribute
302+
modifiedClassName="bghl"
303+
attribute="settings.allowHold"
304+
obj={this.props.studio}
305+
type="checkbox"
306+
collection={Studios}
307+
/>
308+
<span className="text-s dimmed field-hint">
309+
{t('When disabled, any HOLD operations will be silently ignored')}
310+
</span>
311+
</label>
312+
299313
<StudioBaselineStatus studioId={this.props.studio._id} />
300314
</div>
301315
)

0 commit comments

Comments
 (0)