Skip to content

Add a lineup model that retains every provider position - #18

Merged
daniel-widrick merged 1 commit into
feature/raw-gracenote-fieldsfrom
feature/lineup-model
Sep 13, 2026
Merged

daniel-widrick merged 1 commit into
feature/raw-gracenote-fieldsfrom
feature/lineup-model

Conversation

@daniel-widrick

Copy link
Copy Markdown
Owner

PR 2 of #15. Stacked on #17.

Changes

  • guide.TVGuide gains Lineup []LineupPosition and Source. A position is one channel number carrying one station; the same station at two numbers is two positions. Keyed by number plus station ID, since Gracenote's row id is just the station ID with a row index appended and is not stable.
  • guide.ConvertLineupPosition, guide.SortLineup, and guide.SourceFromPreferences are new. ChannelNumberLess moves from main into guide with a strict ordering (numeric first, ties by string, then non-numeric).
  • The scrape loop collects positions alongside the existing station-keyed channel map. Station logos resolved by tvlogo are copied onto each position. The BASE_URL proxy rewrite, now a rewriteImageURLs helper, covers position logos. The Jellyfin channel filter applies to positions by channel number and carries Source through.
  • XMLTV output is unchanged. Channels is still the deduplicated station list the template renders.

Tests

  • guide: position conversion and key distinctness, comparator table including numeric/non-numeric mixes and equal-value ties, sort order with tie-breaking, source mapping.
  • main: logo propagation to every position of a station, proxy rewrite over channels, positions, programs, and images including empty-URL handling, channel filter over positions with source carried through.
  • The XMLTV golden test from Keep raw Gracenote fields on channels and programs #17 still passes unchanged.

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.
@daniel-widrick
daniel-widrick merged commit c1777f7 into feature/raw-gracenote-fields Sep 13, 2026
1 check 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.

1 participant