Interstitial insertion in schedule engine #4

Closed
opened 2026-07-12 05:47:28 +00:00 by GKaszewski · 0 comments
Owner

Parent

#2

What to build

Wire the InterstitialRule (already modeled on ProgrammingBlock) into the schedule engine. After the engine fills a block with program items, if the block has an interstitial_rule, query the library for MediaItems with role: Interstitial matching the rule's pool_filter, then insert them between program items.

The interstitial slots should appear in the GeneratedSchedule as regular ScheduledSlots — they are scheduled content, just shorter. The min_gap_secs field on InterstitialRule controls the minimum program duration before an interstitial is inserted (don't put a bumper between two 15-second clips).

Acceptance criteria

  • Schedule generation inserts interstitial items between program items when InterstitialRule is set on a ProgrammingBlock
  • Interstitials are sourced from the library filtered by the rule's pool_filter with role: Interstitial
  • No interstitial is inserted when the gap between programs is shorter than min_gap_secs
  • Interstitial slots appear in the GeneratedSchedule as normal ScheduledSlots (the Playout Service doesn't need to know they're interstitials)
  • Test: block with 3 programs + interstitial rule produces 3 programs + 2 interstitials in correct order
  • Test: block with no matching interstitials in the library generates normally (no crash, just no interstitials)

Blocked by

None — can start immediately

## Parent #2 ## What to build Wire the InterstitialRule (already modeled on ProgrammingBlock) into the schedule engine. After the engine fills a block with program items, if the block has an `interstitial_rule`, query the library for MediaItems with `role: Interstitial` matching the rule's `pool_filter`, then insert them between program items. The interstitial slots should appear in the GeneratedSchedule as regular ScheduledSlots — they are scheduled content, just shorter. The `min_gap_secs` field on InterstitialRule controls the minimum program duration before an interstitial is inserted (don't put a bumper between two 15-second clips). ## Acceptance criteria - [ ] Schedule generation inserts interstitial items between program items when InterstitialRule is set on a ProgrammingBlock - [ ] Interstitials are sourced from the library filtered by the rule's pool_filter with `role: Interstitial` - [ ] No interstitial is inserted when the gap between programs is shorter than `min_gap_secs` - [ ] Interstitial slots appear in the GeneratedSchedule as normal ScheduledSlots (the Playout Service doesn't need to know they're interstitials) - [ ] Test: block with 3 programs + interstitial rule produces 3 programs + 2 interstitials in correct order - [ ] Test: block with no matching interstitials in the library generates normally (no crash, just no interstitials) ## Blocked by None — can start immediately
GKaszewski added the ready-for-agent label 2026-07-12 05:47:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-tv#4