Skip to content

Inline flowsheet metadata, remove cache tables#305

Merged
jakebromberg merged 5 commits intomainfrom
worktree-refactor+inline-flowsheet-metadata
Apr 5, 2026
Merged

Inline flowsheet metadata, remove cache tables#305
jakebromberg merged 5 commits intomainfrom
worktree-refactor+inline-flowsheet-metadata

Conversation

@jakebromberg
Copy link
Copy Markdown
Member

Summary

  • Store metadata (artwork_url, streaming URLs, artist_bio, etc.) directly on the flowsheet row instead of in separate album_metadata/artist_metadata cache tables
  • Remove the cache tables, cache key logic, and 3 LEFT JOINs per flowsheet query
  • Fetch metadata from LML fire-and-forget on insert, update the flowsheet row directly
  • Net -682 lines; LML's own caching makes the backend cache layer unnecessary

Closes #304

Test plan

  • npm run test:unit passes (571 tests, verified locally)
  • CI typecheck + lint + tests pass
  • Set LIBRARY_METADATA_URL in production environment
  • After deploy: POST /flowsheet with a track, then GET /flowsheet — verify metadata fields populate after async fetch

Jake Bromberg added 4 commits April 5, 2026 13:41
Move metadata columns (artwork_url, discogs_url, release_year, streaming URLs, artist_bio, artist_wikipedia_url) directly onto the flowsheet table. Remove the album_metadata and artist_metadata cache tables which duplicated caching already provided by LML and had a cache key mismatch bug that caused metadata to never appear in responses.

The metadata service now returns data for the caller to persist rather than writing to separate cache tables. The flowsheet controller fetches metadata from LML fire-and-forget on insert and updates the flowsheet row directly.
FSEntry now includes metadata columns since they're on the flowsheet table, so IFSEntry (which extends FSEntry) requires them at the top level in addition to the nested metadata object.
@jakebromberg jakebromberg force-pushed the worktree-refactor+inline-flowsheet-metadata branch from f29ca97 to 3e0a822 Compare April 5, 2026 20:42
jakebromberg pushed a commit that referenced this pull request Apr 5, 2026
Replace album_metadata table lookups with flowsheet table queries for artwork enrichment. The album_metadata table is being removed in #305; the flowsheet table now has artwork_url inline. Uses the same normalized key-based matching pattern but queries flowsheet directly.
@jakebromberg jakebromberg force-pushed the worktree-refactor+inline-flowsheet-metadata branch from dade551 to 7f930ef Compare April 5, 2026 21:55
@jakebromberg jakebromberg merged commit f4758fe into main Apr 5, 2026
4 checks 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.

Inline flowsheet metadata and remove cache tables

1 participant