iCalendar export (ScheduleConfig → .ics) #15

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

Parent

#2

What to build

Export a Channel's ScheduleConfig as an iCalendar (.ics) file per RFC 5545. Each ProgrammingBlock maps to a VEVENT with RRULE for weekly recurrence. K-tv-specific properties (filter, strategy, interstitial_rule, mid_roll_rule) are stored in X-KTV-* custom properties.

Implement as a pure domain service function (like generate_m3u/generate_xmltv). Add an API endpoint (e.g., GET /channels/:id/export.ics) and an MCP tool.

Acceptance criteria

  • Pure function: ScheduleConfig + Channel metadata → iCalendar string
  • Each ProgrammingBlock produces a VEVENT with correct DTSTART, DURATION, RRULE (weekly on the appropriate day)
  • Block name → SUMMARY
  • BlockContent serialized in X-KTV-CONTENT custom property
  • FillStrategy in X-KTV-STRATEGY
  • InterstitialRule in X-KTV-INTERSTITIAL (if present)
  • MidRollRule in X-KTV-MIDROLL (if present)
  • API endpoint serves the .ics file with correct Content-Type (text/calendar)
  • Test: roundtrip — export a ScheduleConfig, verify the iCal string contains correct VEVENTs and RRULEs
  • Test: blocks on different days produce different RRULE BYDAY values

Blocked by

None — can start immediately

## Parent #2 ## What to build Export a Channel's ScheduleConfig as an iCalendar (.ics) file per RFC 5545. Each ProgrammingBlock maps to a VEVENT with RRULE for weekly recurrence. K-tv-specific properties (filter, strategy, interstitial_rule, mid_roll_rule) are stored in X-KTV-* custom properties. Implement as a pure domain service function (like generate_m3u/generate_xmltv). Add an API endpoint (e.g., `GET /channels/:id/export.ics`) and an MCP tool. ## Acceptance criteria - [ ] Pure function: ScheduleConfig + Channel metadata → iCalendar string - [ ] Each ProgrammingBlock produces a VEVENT with correct DTSTART, DURATION, RRULE (weekly on the appropriate day) - [ ] Block name → SUMMARY - [ ] BlockContent serialized in X-KTV-CONTENT custom property - [ ] FillStrategy in X-KTV-STRATEGY - [ ] InterstitialRule in X-KTV-INTERSTITIAL (if present) - [ ] MidRollRule in X-KTV-MIDROLL (if present) - [ ] API endpoint serves the .ics file with correct Content-Type (text/calendar) - [ ] Test: roundtrip — export a ScheduleConfig, verify the iCal string contains correct VEVENTs and RRULEs - [ ] Test: blocks on different days produce different RRULE BYDAY values ## Blocked by None — can start immediately
GKaszewski added the ready-for-agent label 2026-07-12 05:49:55 +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#15