feat(calendar): add group=day param + grouped episode shape#850
Merged
Conversation
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.
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related changes to the calendar contract.
1.
?group=dayon 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_typegainsfull_season/multiple_episodes, andepisodesholds the collapsed group (both nullish; the sharedepisodeResponseSchemais 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 bymedia+releasesHot) moves fromz.union([movie, show])to a single flat object with every field nullish. OpenAPI codegen renders a uniononeOfas 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 newAGENTS.md.Why
Backs moving trakt-web's
coalesceEpisodesserver-side (trakt/trakt-workers#1183) and fixes the union-response codegen for consumers.Version
Bumps
@trakt/apito 0.4.24.