Skip to content

Preserve release-local timestamps and timezones; increase cache TTL - #2

Draft
x-n2o wants to merge 1 commit into
mainfrom
remove-utc-midnight-requirement
Draft

Preserve release-local timestamps and timezones; increase cache TTL#2
x-n2o wants to merge 1 commit into
mainfrom
remove-utc-midnight-requirement

Conversation

@x-n2o

@x-n2o x-n2o commented May 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Emit calendar events using release-local timestamps and preserve human-readable IANA time zones instead of forcing UTC so calendar clients display correct local times.
  • Ensure the ICS generator includes timezone metadata when available and make platform strategies carry timezone information.
  • Increase edge cache lifetime for generated feeds.

Description

  • Change release strategies to floating times and add a strategyTimeZone mapping with human-readable IANA zones, and introduce validators/normalizers: isoDatePattern, timePattern, isoDateTimePattern, combineDateAndTime, and normalizeIsoDateTime.
  • Add resolveReleaseTimeZone and return a timeZone on ShowEpisode when a platform strategy applies, and include timeZone in generated ICS events by setting the event timezone property in generateICS.
  • Update types by adding timeZone?: string to ShowEpisode and adjust getShowEpisodes to populate timeZone and startsAt via resolveReleaseTimeZone/resolveDateTime.
  • Increase Cache-Control header from max-age=1800 to max-age=3600.
  • Update tests to reflect new behaviors and validations and adapt expected timestamp formats (no forced Z for midnight and platform strategies return floating midnight plus timezone info).

Testing

  • Ran unit tests with vitest, including release.test.ts, tmdb.test.ts, and router.test.ts, and all tests passed.
  • Exercised generateICS changes via router tests to confirm Content-Type, Cache-Control, and event SUMMARY remained correct under the new timezone handling.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant