iCalendar import (.ics → ScheduleConfig) #16

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

Parent

#2

What to build

Import an iCalendar (.ics) file to create or update a Channel's ScheduleConfig. Parse VEVENTs, extract RRULE for weekday mapping, read X-KTV-* custom properties to reconstruct BlockContent, FillStrategy, InterstitialRule, and MidRollRule.

Implement as a pure domain service function (iCal string → ScheduleConfig). Add an API endpoint (e.g., POST /channels/:id/import with the .ics file as the request body) and an MCP tool.

Acceptance criteria

  • Pure function: iCalendar string → ScheduleConfig
  • VEVENTs with RRULE BYDAY are mapped to the correct Weekday
  • DTSTART + DURATION → ProgrammingBlock start_time + duration_mins
  • SUMMARY → block name
  • X-KTV-CONTENT → BlockContent
  • X-KTV-STRATEGY → FillStrategy
  • X-KTV-INTERSTITIAL → InterstitialRule (if present)
  • X-KTV-MIDROLL → MidRollRule (if present)
  • API endpoint accepts .ics upload and applies the parsed config to the channel
  • Test: roundtrip — export then import produces an equivalent ScheduleConfig
  • Test: .ics without X-KTV-* properties produces blocks with sensible defaults (Algorithmic, Random)
  • Test: invalid .ics returns a clear validation error

Blocked by

  • #15 (iCalendar export — defines the X-KTV-* property format that import must parse)
## Parent #2 ## What to build Import an iCalendar (.ics) file to create or update a Channel's ScheduleConfig. Parse VEVENTs, extract RRULE for weekday mapping, read X-KTV-* custom properties to reconstruct BlockContent, FillStrategy, InterstitialRule, and MidRollRule. Implement as a pure domain service function (iCal string → ScheduleConfig). Add an API endpoint (e.g., `POST /channels/:id/import` with the .ics file as the request body) and an MCP tool. ## Acceptance criteria - [ ] Pure function: iCalendar string → ScheduleConfig - [ ] VEVENTs with RRULE BYDAY are mapped to the correct Weekday - [ ] DTSTART + DURATION → ProgrammingBlock start_time + duration_mins - [ ] SUMMARY → block name - [ ] X-KTV-CONTENT → BlockContent - [ ] X-KTV-STRATEGY → FillStrategy - [ ] X-KTV-INTERSTITIAL → InterstitialRule (if present) - [ ] X-KTV-MIDROLL → MidRollRule (if present) - [ ] API endpoint accepts .ics upload and applies the parsed config to the channel - [ ] Test: roundtrip — export then import produces an equivalent ScheduleConfig - [ ] Test: .ics without X-KTV-* properties produces blocks with sensible defaults (Algorithmic, Random) - [ ] Test: invalid .ics returns a clear validation error ## Blocked by - #15 (iCalendar export — defines the X-KTV-* property format that import must parse)
GKaszewski added the ready-for-agent label 2026-07-12 05:50:06 +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#16