Skip to content

Commit 044c222

Browse files
committed
feat: option to disable piece direct playing
1 parent b065dd0 commit 044c222

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

packages/corelib/src/dataModel/Studio.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ export interface IStudioSettings {
9595
* This should only block entering hold, to ensure Sofie doesn't get stuck if it somehow gets into hold
9696
*/
9797
allowHold?: boolean
98+
99+
/**
100+
* Whether to allow direct playing of a piece in the rundown
101+
* This behaviour is usally triggered by double-clicking on a piece in the GUI
102+
*/
103+
allowPieceDirectPlay?: boolean
98104
}
99105

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import { PlayoutPieceInstanceModel } from './model/PlayoutPieceInstanceModel'
3535
* Play an existing Piece in the Rundown as an AdLib
3636
*/
3737
export async function handleTakePieceAsAdlibNow(context: JobContext, data: TakePieceAsAdlibNowProps): Promise<void> {
38+
if (!context.studio.settings.allowPieceDirectPlay) {
39+
// Piece direct play isn't allowed, making this a noop
40+
logger.debug(`Piece direct play isn't allowed, skipping`)
41+
return
42+
}
43+
3844
return runJobWithPlayoutModel(
3945
context,
4046
data,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,8 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
22522252
item &&
22532253
item.instance &&
22542254
this.props.playlist &&
2255-
this.props.playlist.currentPartInfo
2255+
this.props.playlist.currentPartInfo &&
2256+
this.props.studio?.settings.allowPieceDirectPlay
22562257
) {
22572258
const idToCopy = item.instance.isTemporary ? item.instance.piece._id : item.instance._id
22582259
const playlistId = this.props.playlist._id

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ export const StudioGenericProperties = withTranslation()(
310310
</span>
311311
</label>
312312

313+
<label className="field">
314+
<LabelActual label={t('Allow direct playing pieces')} />
315+
<EditAttribute
316+
modifiedClassName="bghl"
317+
attribute="settings.allowPieceDirectPlay"
318+
obj={this.props.studio}
319+
type="checkbox"
320+
collection={Studios}
321+
/>
322+
<span className="text-s dimmed field-hint">
323+
{t('When enabled, double clicking on certain pieces in the GUI will play them as adlibs')}
324+
</span>
325+
</label>
326+
313327
<StudioBaselineStatus studioId={this.props.studio._id} />
314328
</div>
315329
)

0 commit comments

Comments
 (0)