fix(frontend): inherit album cover when a track has no per-track image (#1337)
the player bar already falls back to `track.album?.image_url` when the
per-track image is unset, but the track detail page, track-list items,
track grid cards, and the embed surface all rendered a placeholder
instead. result: the same track shows artwork in the player and a
blank in every other surface, including its own detail page.
extracted the inheritance rule into `lib/track-cover.ts`
(`trackCoverUrl` + `trackThumbnailUrl`) so every cover-rendering
surface routes through the same helper. semantically this models
the relationship correctly — the album HAS the art, the track
INHERITS unless it sets its own — instead of denormalizing the
album cover into each track row, which would silently go stale if
the album cover ever changed.
side benefit: the recent /tmp upload bug (#1336) orphaned 3 tracks
with `image_id IS NULL` while their album record kept its cover.
those tracks now render the album cover at view time without any
DB backfill, and without needing the artist to re-upload.
surfaces touched:
- routes/track/[id]/+page.svelte — visible cover + og:image cascade
both routed through the helper; previewIsTrackArt simplifies to
`coverUrl !== undefined`
- lib/components/TrackItem.svelte — list item (used in album page,
my tracks, search results, etc.)
- lib/components/TrackCard.svelte — grid card
- routes/embed/track/[id]/+page.svelte — third-party embed (bg blur,
desktop side art, mobile art card all share the same coverUrl)
ATProto track records are unchanged: artists who didn't upload a
per-track image still don't claim one in their portable record.
Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
authored by