Gap filler logic (schedule engine + API) #8

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

Parent

#2

What to build

Wire the gap_filler field on Channel (already modeled as Option<MediaFilter>) into the system. When a channel has a gap_filler set and no ScheduledSlot covers the current time, the system should resolve interstitial content to fill the gap instead of returning no-signal (HTTP 204).

The gap filler logic belongs in the schedule generation or the Playout Service's runtime loop. For now, implement it in the schedule engine: when generating a schedule, detect gaps between blocks and fill them with interstitial content matching the channel's gap_filler filter. Gap filler slots appear as regular ScheduledSlots.

Expose gap_filler in the channel create/update API and MCP tools.

Acceptance criteria

  • Channel with gap_filler set produces filler slots in gaps between ProgrammingBlocks
  • Filler content is sourced from the library with role: Interstitial matching the gap_filler MediaFilter
  • Channel without gap_filler still returns no-signal (204) during gaps — no behavior change
  • Channel create/update API accepts gap_filler field
  • MCP tools support setting gap_filler on channel create/update
  • Test: channel with 2 blocks and a gap between them gets filler slots in the gap
  • Test: channel without gap_filler has empty gap (no filler slots)

Blocked by

  • #4 (Interstitial insertion — shared interstitial sourcing pattern)
## Parent #2 ## What to build Wire the `gap_filler` field on Channel (already modeled as `Option<MediaFilter>`) into the system. When a channel has a gap_filler set and no ScheduledSlot covers the current time, the system should resolve interstitial content to fill the gap instead of returning no-signal (HTTP 204). The gap filler logic belongs in the schedule generation or the Playout Service's runtime loop. For now, implement it in the schedule engine: when generating a schedule, detect gaps between blocks and fill them with interstitial content matching the channel's gap_filler filter. Gap filler slots appear as regular ScheduledSlots. Expose gap_filler in the channel create/update API and MCP tools. ## Acceptance criteria - [ ] Channel with gap_filler set produces filler slots in gaps between ProgrammingBlocks - [ ] Filler content is sourced from the library with `role: Interstitial` matching the gap_filler MediaFilter - [ ] Channel without gap_filler still returns no-signal (204) during gaps — no behavior change - [ ] Channel create/update API accepts gap_filler field - [ ] MCP tools support setting gap_filler on channel create/update - [ ] Test: channel with 2 blocks and a gap between them gets filler slots in the gap - [ ] Test: channel without gap_filler has empty gap (no filler slots) ## Blocked by - #4 (Interstitial insertion — shared interstitial sourcing pattern)
GKaszewski added the ready-for-agent label 2026-07-12 05:48:23 +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#8