@@ -10,7 +10,6 @@ import { unprotectString, protectString } from '@sofie-automation/corelib/dist/p
10
10
import { logger } from '../logging'
11
11
import { PlayoutModel } from '../playout/model/PlayoutModel'
12
12
import { PlayoutRundownModel } from '../playout/model/PlayoutRundownModel'
13
- import { isTooCloseToAutonext } from '../playout/lib'
14
13
import { allowedToMoveRundownOutOfPlaylist } from '../rundown'
15
14
import { updatePartInstanceRanksAndOrphanedState } from '../updatePartInstanceRanksAndOrphanedState'
16
15
import {
@@ -224,8 +223,6 @@ export async function CommitIngestOperation(
224
223
const pSaveIngest = ingestModel . saveAllToDatabase ( )
225
224
pSaveIngest . catch ( ( ) => null ) // Ensure promise isn't reported as unhandled
226
225
227
- ensureNextPartInstanceIsNotDeleted ( playoutModel )
228
-
229
226
await validateAdlibTestingSegment ( context , playoutModel )
230
227
231
228
try {
@@ -284,19 +281,9 @@ function canRemoveSegment(
284
281
logger . warn ( `Not allowing removal of current playing segment "${ segmentId } ", making segment unsynced instead` )
285
282
return false
286
283
}
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 ) {
296
285
// 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` )
300
287
return false
301
288
}
302
289
@@ -855,12 +842,3 @@ async function validateAdlibTestingSegment(_context: JobContext, playoutModel: P
855
842
rundown . updateAdlibTestingSegmentRank ( )
856
843
}
857
844
}
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