Skip to content

feat(calendar): add group=day param + grouped episode shape#850

Merged
vladjerca merged 1 commit into
masterfrom
feat/calendar_group
Jul 14, 2026
Merged

feat(calendar): add group=day param + grouped episode shape#850
vladjerca merged 1 commit into
masterfrom
feat/calendar_group

Conversation

@vladjerca

@vladjerca vladjerca commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

Two related changes to the calendar contract.

1. ?group=day on the episode-bearing feeds that can carry multiple same-day episodes per show (shows, media, releasesHot). Collapses same-show-same-day episodes into one card. A calendar-specific episode schema (calendarEpisodeResponseSchema) carries the grouping fields - episode_type gains full_season / multiple_episodes, and episodes holds the collapsed group (both nullish; the shared episodeResponseSchema is untouched). Not on premieres/finales/new (one per show/day - no-op) or movie-only streaming/dvd.

2. Flat merged-feed shape. The merged-feed response (hotReleaseResponseSchema, used by media + releasesHot) moves from z.union([movie, show]) to a single flat object with every field nullish. OpenAPI codegen renders a union oneOf as a model with all fields required, so consumers generated a wrong schema (per @mike's report). Nullish fields generate a correct optional-field model. Documented as a convention in a new AGENTS.md.

Why

Backs moving trakt-web's coalesceEpisodes server-side (trakt/trakt-workers#1183) and fixes the union-response codegen for consumers.

Version

Bumps @trakt/api to 0.4.24.

Adds an opt-in `?group=day` query param to the episode-bearing calendar
endpoints that can carry multiple same-day episodes per show (`shows`, `media`,
`releasesHot`), and a calendar-specific episode schema that carries the grouping
fields: `episode_type` gains the computed `full_season` / `multiple_episodes`
card types and `episodes` holds the collapsed group. Both are nullish, so one
response shape covers the raw and grouped feeds; the shared
`episodeResponseSchema` is untouched. Bumps the package to 0.4.24.
@vladjerca vladjerca merged commit e0ff7d6 into master Jul 14, 2026
3 checks passed
@vladjerca vladjerca deleted the feat/calendar_group branch July 14, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant