File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,9 @@ export async function CommitIngestOperation(
221221 // sync changes to the 'selected' partInstances
222222 await syncChangesToPartInstances ( context , playoutModel , ingestModel )
223223
224+ // update the quickloop in case we did any changes to things involving marker
225+ playoutModel . updateQuickLoopState ( )
226+
224227 playoutModel . deferAfterSave ( ( ) => {
225228 // Run in the background, we don't want to hold onto the lock to do this
226229 context
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ export class QuickLoopService {
6565
6666 this . resetDynamicallyInsertedPartOverrideIfNoLongerNeeded ( quickLoopProps )
6767
68+ // remove the marker if it no longer exists inside the rundown
69+ if ( quickLoopProps . start && ! this . doesMarkerExist ( quickLoopProps . start ) ) delete quickLoopProps . start
70+ if ( quickLoopProps . end && ! this . doesMarkerExist ( quickLoopProps . end ) ) delete quickLoopProps . end
71+
6872 if ( quickLoopProps . start == null || quickLoopProps . end == null ) {
6973 quickLoopProps . running = false
7074 } else {
@@ -177,6 +181,27 @@ export class QuickLoopService {
177181 }
178182 }
179183
184+ /**
185+ * Check whether the thing a marker references still exists within the playlist
186+ * @param marker Marker to find
187+ */
188+ private doesMarkerExist ( marker : QuickLoopMarker ) {
189+ let found = false
190+
191+ if ( marker . type === QuickLoopMarkerType . PART ) {
192+ found = ! ! this . playoutModel . findPart ( marker . id )
193+ } else if ( marker . type === QuickLoopMarkerType . SEGMENT ) {
194+ found = ! ! this . playoutModel . findSegment ( marker . id )
195+ } else if ( marker . type === QuickLoopMarkerType . RUNDOWN ) {
196+ found = ! ! this . playoutModel . getRundown ( marker . id )
197+ } else {
198+ // we can't lose the playlist so that marker is always valid
199+ found = true
200+ }
201+
202+ return found
203+ }
204+
180205 private findPartPosition (
181206 partInstance : PlayoutPartInstanceModel | null ,
182207 rundownIds : RundownId [ ]
You can’t perform that action at this time.
0 commit comments