Skip to content

Serve the provider lineup at /api/lineup.json - #19

Merged
daniel-widrick merged 1 commit into
feature/lineup-modelfrom
feature/lineup-endpoint
Sep 13, 2026
Merged

daniel-widrick merged 1 commit into
feature/lineup-modelfrom
feature/lineup-endpoint

Conversation

@daniel-widrick

Copy link
Copy Markdown
Owner

PR 3 of #15. Stacked on #18.

Changes

  • New GET /api/lineup.json: every position in the active lineup, sorted by channel number, with station ID, placement ID, callsign, affiliate, affiliate callsign, Gracenote station filters, and the resolved logo URL. A station carried at two numbers appears twice.
  • The source block carries the lineup identifiers from the guide itself. Provider name, type, and location are filled from the saved setup only when it describes the same lineup the guide was built from, so a stale guide can never be labeled with a newer provider's name.
  • 503 with Retry-After: 30 until the first guide exists, same CORS header and encoder settings as /api/guide.json.
  • README gains the endpoint row and a documented example response. CLAUDE.md notes the lineup model and the cache schema version.

Tests

lineup_handler_test.go covers: 503 before the first guide; full response decode with sort order, field mapping, and duplicate-station positions; exact JSON key sets at every level so a rename fails loudly, including filters omitted when empty and logoUrl always present; provider naming blank with no config and blank when the config describes a different lineup; and that serialization sorts a copy rather than the live guide.

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.
@daniel-widrick
daniel-widrick merged commit 9eabf62 into feature/lineup-model 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