Skip to content

Add enrichment proxy for tubafrenzy v1 playlist API#279

Merged
jakebromberg merged 4 commits intomainfrom
feature/playlist-proxy
Apr 5, 2026
Merged

Add enrichment proxy for tubafrenzy v1 playlist API#279
jakebromberg merged 4 commits intomainfrom
feature/playlist-proxy

Conversation

@jakebromberg
Copy link
Copy Markdown
Member

Summary

  • Subscribe to tubafrenzy's SSE stream (/playlists/recentStream) to maintain the current playlist in memory
  • Enrich each playcut with artworkURL from album_metadata via batch cache-key lookup
  • Serve enriched playlist at GET /playlists/recentEntries — matches tubafrenzy's exact URL path and response shape
  • Unauthenticated (legacy client compatibility), Cache-Control: public, max-age=30, 503 on cold start

Closes #278

Test plan

  • 20 service unit tests (SSE parsing, enrichment, CRUD events, edge cases)
  • 9 controller unit tests (happy path, caching, param handling, cold start, graceful degradation)
  • Typecheck passes
  • Integration test: curl 'http://localhost:8080/playlists/recentEntries?v=2&n=5' returns enriched response
  • Verify artworkURL present on playcuts that have metadata in album_metadata
  • Verify talksets/breakpoints unchanged from tubafrenzy format

Jake Bromberg added 3 commits April 1, 2026 15:45
Subscribe to tubafrenzy's SSE stream (/playlists/recentStream) to maintain
the current playlist in memory, enrich each playcut with artworkURL from
the album_metadata table, and serve via GET /playlists/recentEntries.

This endpoint matches tubafrenzy's exact URL path and response shape so
that when wxyc.info DNS is rerouted to api.wxyc.org, legacy clients
continue working transparently. The artworkURL field is ignored by clients
that don't know about it; the iOS app already decodes it via
decodeIfPresent.

Unauthenticated, Cache-Control: public max-age=30, 503 on cold start,
graceful degradation if DB enrichment fails.
Address review findings: cap the in-memory entries array at 200 to prevent unbounded growth from SSE created events (oldest entries are trimmed and their artwork map entries cleaned up), build new artwork map on success only so existing artwork data is preserved if the DB query fails during re-init, and add tests for both behaviors.
@jakebromberg jakebromberg force-pushed the feature/playlist-proxy branch from dee3d21 to 70849ad Compare April 1, 2026 23:01
@jakebromberg jakebromberg merged commit 33a3b19 into main Apr 5, 2026
4 checks passed
@jakebromberg jakebromberg deleted the feature/playlist-proxy branch April 5, 2026 19:41
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.

Add enrichment proxy for tubafrenzy v1 playlist API

1 participant