Skip to content

Land the #15 lineup stack on main - #21

Merged
daniel-widrick merged 7 commits into
mainfrom
feature/lineup-stack
Sep 13, 2026
Merged

daniel-widrick merged 7 commits into
mainfrom
feature/lineup-stack

Conversation

@daniel-widrick

Copy link
Copy Markdown
Owner

Re-lands #17, #18, #19, and #20 against main. Those PRs were merged into each other's branches rather than into main, so only the CI workflow from #16 actually landed. This branch is the same linear history the stack was reviewed with, and its tree is identical to the merged tip of feature/lineup-endpoint.

Contents, unchanged from the original PRs:

Closes #15.

Factor template rendering out of persistGuideFiles into renderXMLTV so
tests can render to a buffer. The golden file is generated from the
current conversion code before any model changes.
Carry the row id, affiliate callsign, and station filters through to
guide.Channel, and the TMS id, release year, generic flag, and raw event
filters through to guide.Program. Categories are unchanged; Filters
holds the Gracenote list before Series and Finale are appended.

releaseYear and isGeneric use tolerant decoders so an unexpected scalar
encoding cannot fail an entire six-hour grid.

The guide cache gains a schema version. An older cache is rebuilt once
so the new fields are populated.
*.xmltv is ignored repo-wide, which kept the golden out of the first
commit. Allowlist it explicitly.
TVGuide gains Lineup, a list of channel positions keyed by number and
station that is never collapsed, and Source, which records the lineup
the guide was built from. Resolved station logos are copied onto each
position, the image proxy rewrite covers them, and the Jellyfin channel
filter applies to them by channel number.

ChannelNumberLess moves into the guide package with a strict ordering:
numeric numbers first, ties broken by string, then non-numeric.
One entry per channel position, sorted by number, with station metadata,
Gracenote station filters, and the resolved logo. Provider name, type,
and location come from the saved setup when it matches the lineup the
guide was built from. Returns 503 with Retry-After until the first guide
exists, matching /api/guide.json.
scrape.Fetch(ctx, prefs, opts) downloads every six-hour slot for a
lineup and assembles a guide.TVGuide: stations deduplicated in
first-seen order, every lineup position retained, programs deduplicated.
It does no enrichment, file I/O, or environment reads.

main.runScrape now calls it, mapping progress to the setup status and
cancelling the context when the active lineup changes mid-download.

Behavior change: when every slot fails, the scrape is now an error
(scrape.ErrNoData) instead of writing an empty guide, so the previous
guide stays live and the 15-minute retry applies. Channel order in the
XMLTV output is now first-seen rather than map order.
@daniel-widrick
daniel-widrick merged commit ce45cc8 into main Sep 13, 2026
2 checks passed
@daniel-widrick
daniel-widrick deleted the feature/lineup-stack branch September 13, 2026 04:05
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.

Expose provider lineup data as a first-class output (positions, station metadata, library entry point)

1 participant