fix(570): On Now/Next overlay YAML renders (font_family + format_datetime) #571

Merged
timothy merged 1 commits from fix/74-overlay-render into main 2026-07-22 23:39:33 +02:00
Owner

Fixes the #74 On Now/Next overlay, which never rendered at transcode time (the seeded on-now-next.yml failed to load, so the element was silently ignored). Found by live visual E2E on ersatztv-test.

Two bugs in the seeded YAML

  1. format_datetime wrong arity — the NEXT line called format_datetime (convert_timezone Epg[1].Start) "h:mm tt" (2 args). TemplateFunctions.FormatDateTime(DateTimeOffset, timeZoneId, format) takes 3 args and does the tz conversion itself → Scriban render threw. Dropped the NEXT start-time (avoids hardcoding a timezone in a shipped default).
  2. Missing font_family — CustomFontMapper.TypefaceFromStyle does TryGetValue(style.FontFamily, …) with a null key → crash before its default-font fallback. Added font_family: "Noto Sans".

Also switched the array-length guard to the verified (array.size Epg) form.

Verification

  • Live on ersatztv-test: captured a frame of channel 901 with the overlay enabled — the bottom-left NOW/NEXT bug renders correctly (per-line styling, halo). Both the opacity_percent and opacity_expression render paths confirmed; LinearFadeDuration returns 0..1 and peaks at 1.0, so the shipped transient fade renders during its 4–12s window.
  • New seeder test deserializes the YAML and asserts base_style resolves + every style sets a font_family (would have caught the null-font crash). GraphicsElementSeederTests 4/4.
  • Format + BOM gates clean.

Latent follow-up (separate): CustomFontMapper.TypefaceFromStyle should treat a null font_family as "use default" rather than crash.

fixes #570

🤖 Generated with Claude Code

Fixes the #74 On Now/Next overlay, which never rendered at transcode time (the seeded `on-now-next.yml` failed to load, so the element was silently ignored). Found by live visual E2E on ersatztv-test. ## Two bugs in the seeded YAML 1. **`format_datetime` wrong arity** — the NEXT line called `format_datetime (convert_timezone Epg[1].Start) "h:mm tt"` (2 args). `TemplateFunctions.FormatDateTime(DateTimeOffset, timeZoneId, format)` takes **3** args and does the tz conversion itself → Scriban render threw. Dropped the NEXT start-time (avoids hardcoding a timezone in a shipped default). 2. **Missing `font_family`** — `CustomFontMapper.TypefaceFromStyle` does `TryGetValue(style.FontFamily, …)` with a null key → crash **before** its default-font fallback. Added `font_family: "Noto Sans"`. Also switched the array-length guard to the verified `(array.size Epg)` form. ## Verification - Live on ersatztv-test: captured a frame of channel 901 with the overlay enabled — the bottom-left NOW/NEXT bug renders correctly (per-line styling, halo). Both the `opacity_percent` and `opacity_expression` render paths confirmed; `LinearFadeDuration` returns 0..1 and peaks at 1.0, so the shipped transient fade renders during its 4–12s window. - New seeder test deserializes the YAML and asserts `base_style` resolves + every style sets a `font_family` (would have caught the null-font crash). `GraphicsElementSeederTests` 4/4. - Format + BOM gates clean. Latent follow-up (separate): `CustomFontMapper.TypefaceFromStyle` should treat a null `font_family` as "use default" rather than crash. fixes #570 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy added 1 commit 2026-07-22 23:11:32 +02:00
fix(570): On Now/Next overlay YAML renders — font_family + format_datetime
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 13s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 16s
PR Gates / Docs update reminder (pull_request) Successful in 17s
PR Gates / decisions lifecycle (pull_request) Successful in 21s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m28s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 15m46s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 15m50s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 20m18s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
892f4e354b
The #74 seeded on-now-next.yml never rendered at transcode time:
- format_datetime was called with 2 args; it needs 3 (DateTimeOffset, timeZoneId,
  format) and does the tz conversion itself, so the Scriban render threw. Drop the
  NEXT start-time (avoids hardcoding a timezone in a shipped default).
- styles had no font_family; CustomFontMapper.TypefaceFromStyle crashes on a null
  family before its default-font fallback. Add font_family: Noto Sans.
Verified live on ersatztv-test via frame capture. Adds a seeder test that
deserializes the YAML and asserts base_style resolves + every style sets a font.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Owner

Review-verdict: MERGEABLE @ 892f4e35

No-logic content+test fix. Verified LIVE on ersatztv-test by frame capture (overlay renders NOW/NEXT). Formal cross-model review skipped per the independent-review rubric (no logic/state/migration change; the live render is the verification). Seeder guard test green; format/BOM clean.

Review-verdict: MERGEABLE @ 892f4e35 No-logic content+test fix. Verified LIVE on ersatztv-test by frame capture (overlay renders NOW/NEXT). Formal cross-model review skipped per the independent-review rubric (no logic/state/migration change; the live render is the verification). Seeder guard test green; format/BOM clean.
timothy merged commit 5a7a4ed7e0 into main 2026-07-22 23:39:33 +02:00
timothy deleted branch fix/74-overlay-render 2026-07-22 23:39:33 +02:00
Sign in to join this conversation.