Skip to content

Fix HBO primetime release time to use ET-local conversion - #3

Merged
x-n2o merged 1 commit into
mainfrom
claude/verify-euphoria-times-4hk0p
May 16, 2026
Merged

x-n2o merged 1 commit into
mainfrom
claude/verify-euphoria-times-4hk0p

Conversation

@x-n2o

@x-n2o x-n2o commented May 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

While double-checking Euphoria's published times, I noticed the calendar event for S03E06 ("Stand Still and See") was landing about 23 hours too early.

What went wrong

US_PRIMETIME was a literal UTC string ("02:00:00Z") stamped on the TMDb air_date. TMDb's air_date is the local US broadcast date, but HBO airs in late-evening ET — so the resulting UTC moment fell on the previous day in ET:

Episode TMDb air_date Old startsAt In ET Actual HBO broadcast
Euphoria S03E06 2026-05-17 2026-05-17T02:00:00Z Sat May 16, 10pm EDT Sun May 17, 9pm EDT (2026-05-18T01:00:00Z)

The PT/ET midnight strategies already do DST-aware local→UTC conversion via localMidnightToUtc. US_PRIMETIME did not.

Fix

  • Treat US_PRIMETIME as 21:00 America/New_York and reuse the DST-aware local-to-UTC conversion (generalized localMidnightToUtc → localTimeToUtc).
  • Restructure strategies so each entry is either { localTime, timezone } or { utc }.
  • Drop Euphoria's redundant releaseTime: "02:00:00Z" override so it picks up the corrected HBO strategy.
  • Update README to document the new local-time, DST-aware strategies.

Test plan

  • pnpm test — 30 passed (added two HBO regression tests covering EDT and EST air dates)
  • pnpm run typecheck
  • pnpm run build
  • Re-subscribe to /api/cal/euphoria.ics and confirm S03E06 now shows Mon May 18 02:00 BST (i.e., Sun May 17 9pm EDT) in the calendar client

US_PRIMETIME was a literal UTC time ("02:00:00Z") stamped on the TMDb
air_date. Because TMDb's air_date is the local US broadcast date and HBO
airs in late-evening ET, the resulting moment landed on the previous
UTC day in ET (e.g. Euphoria S03E06 with air_date 2026-05-17 became
Sat May 16, 10pm ET instead of Sun May 17, 9pm ET).

Treat US_PRIMETIME as 21:00 America/New_York and reuse the DST-aware
local-to-UTC conversion already used by the PT/ET midnight strategies.
Drop Euphoria's redundant releaseTime override so it picks up the
corrected HBO strategy.
Copilot AI review requested due to automatic review settings May 16, 2026 10:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes HBO primetime release time conversion which was previously stamping a literal UTC string and resulting in events being ~23 hours too early. The fix generalizes the existing DST-aware local→UTC helper to handle arbitrary local times (not just midnight) and restructures strategies as a discriminated union of { localTime, timezone } or { utc }.

Changes:

  • Generalized localMidnightToUtc to localTimeToUtc, accepting a local time component with DST-aware offset resolution.
  • Restructured strategies into a tagged union and routed all resolution through a single resolveStrategyDateTime helper; US_PRIMETIME now means 21:00 America/New_York.
  • Removed redundant releaseTime override on Euphoria, updated README, and added EDT/EST regression tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/release.ts Generalize local-time conversion, refactor strategies to tagged union, simplify resolveDateTime.
src/shows.ts Drop Euphoria's now-redundant releaseTime override.
tests/release.test.ts Add HBO primetime regression tests for both EDT and EST air dates.
README.md Document new local-time, DST-aware strategy format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@x-n2o
x-n2o merged commit 58b9101 into main May 16, 2026
6 checks passed
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.

3 participants