@@ -10,7 +10,6 @@ import { unprotectString, protectString } from '@sofie-automation/corelib/dist/p
1010import { logger } from '../logging'
1111import { PlayoutModel } from '../playout/model/PlayoutModel'
1212import { PlayoutRundownModel } from '../playout/model/PlayoutRundownModel'
13- import { isTooCloseToAutonext } from '../playout/lib'
1413import { allowedToMoveRundownOutOfPlaylist } from '../rundown'
1514import { updatePartInstanceRanksAndOrphanedState } from '../updatePartInstanceRanksAndOrphanedState'
1615import {
@@ -224,8 +223,6 @@ export async function CommitIngestOperation(
224223 const pSaveIngest = ingestModel . saveAllToDatabase ( )
225224 pSaveIngest . catch ( ( ) => null ) // Ensure promise isn't reported as unhandled
226225
227- ensureNextPartInstanceIsNotDeleted ( playoutModel )
228-
229226 await validateAdlibTestingSegment ( context , playoutModel )
230227
231228 try {
@@ -284,19 +281,9 @@ function canRemoveSegment(
284281 logger . warn ( `Not allowing removal of current playing segment "${ segmentId } ", making segment unsynced instead` )
285282 return false
286283 }
287- if ( nextPartInstance ?. segmentId === segmentId && isTooCloseToAutonext ( currentPartInstance , false ) ) {
288- // Don't allow removing an active rundown
289- logger . warn (
290- `Not allowing removal of nexted segment "${ segmentId } ", because it's too close to an auto-next, making segment unsynced instead`
291- )
292- return false
293- }
294-
295- if ( nextPartInstance ?. segmentId === segmentId && nextPartInstance . orphaned === 'adlib-part' ) {
284+ if ( nextPartInstance ?. segmentId === segmentId ) {
296285 // Don't allow removing an active rundown
297- logger . warn (
298- `Not allowing removal of segment "${ segmentId } " which contains nexted adlibbed part, making segment unsynced instead`
299- )
286+ logger . warn ( `Not allowing removal of nexted segment "${ segmentId } ", making segment unsynced instead` )
300287 return false
301288 }
302289
@@ -855,12 +842,3 @@ async function validateAdlibTestingSegment(_context: JobContext, playoutModel: P
855842 rundown . updateAdlibTestingSegmentRank ( )
856843 }
857844}
858- function ensureNextPartInstanceIsNotDeleted ( playoutModel : PlayoutModel ) {
859- if ( playoutModel . nextPartInstance ) {
860- // Check if the segment of the nextPartInstance exists
861- if ( ! playoutModel . findSegment ( playoutModel . nextPartInstance . partInstance . segmentId ) ) {
862- // The segment doesn't exist, set nextPartInstance to null, it'll be set by ensureNextPartIsValid() later.
863- playoutModel . setPartInstanceAsNext ( null , false , false )
864- }
865- }
866- }
0 commit comments