@@ -16,37 +16,26 @@ export function onPiecePlaybackStarted(
1616 context : JobContext ,
1717 playoutModel : PlayoutModel ,
1818 data : {
19- partInstanceId : PartInstanceId | null
19+ partInstanceId : PartInstanceId
2020 pieceInstanceId : PieceInstanceId
2121 startedPlayback : Time
2222 }
2323) : void {
2424 const playlist = playoutModel . playlist
2525
26- if ( ! data . partInstanceId ) {
27- // nocommit - implement for rundown owned
28- logger . warn ( `onPiecePlaybackStarted: Received for a piece without a partInstance` )
26+ if ( ! playlist . activationId ) {
27+ logger . warn ( `onPiecePlaybackStarted: Received for inactive RundownPlaylist "${ playlist . _id } "` )
2928 return
3029 }
3130
3231 const partInstance = playoutModel . getPartInstance ( data . partInstanceId )
3332 if ( ! partInstance ) {
34- if ( ! playlist . activationId ) {
35- logger . warn ( `onPiecePlaybackStarted: Received for inactive RundownPlaylist "${ playlist . _id } "` )
36- } else {
37- throw new Error ( `PartInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
38- }
39- return
33+ throw new Error ( `PartInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
4034 }
4135
4236 const pieceInstance = partInstance . getPieceInstance ( data . pieceInstanceId )
4337 if ( ! pieceInstance ) {
44- if ( ! playlist . activationId ) {
45- logger . warn ( `onPiecePlaybackStarted: Received for inactive RundownPlaylist "${ playlist . _id } "` )
46- } else {
47- throw new Error ( `PieceInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
48- }
49- return
38+ throw new Error ( `PieceInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
5039 }
5140
5241 const isPlaying = ! ! (
@@ -74,16 +63,15 @@ export function onPiecePlaybackStopped(
7463 context : JobContext ,
7564 playoutModel : PlayoutModel ,
7665 data : {
77- partInstanceId : PartInstanceId | null
66+ partInstanceId : PartInstanceId
7867 pieceInstanceId : PieceInstanceId
7968 stoppedPlayback : Time
8069 }
8170) : void {
8271 const playlist = playoutModel . playlist
8372
84- if ( ! data . partInstanceId ) {
85- // nocommit - implement for rundown owned
86- logger . warn ( `onPiecePlaybackStopped: Received for a piece without a partInstance` )
73+ if ( ! playlist . activationId ) {
74+ logger . warn ( `onPiecePlaybackStopped: Received for inactive RundownPlaylist "${ playlist . _id } "` )
8775 return
8876 }
8977
@@ -95,12 +83,7 @@ export function onPiecePlaybackStopped(
9583
9684 const pieceInstance = partInstance . getPieceInstance ( data . pieceInstanceId )
9785 if ( ! pieceInstance ) {
98- if ( ! playlist . activationId ) {
99- logger . warn ( `onPiecePlaybackStopped: Received for inactive RundownPlaylist "${ playlist . _id } "` )
100- } else {
101- throw new Error ( `PieceInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
102- }
103- return
86+ throw new Error ( `PieceInstance "${ data . partInstanceId } " in RundownPlaylist "${ playlist . _id } " not found!` )
10487 }
10588
10689 const isPlaying = ! ! (
0 commit comments