Library split: Albums + Artists pages, artist hero redesign, Wikipedia bios, casing cleanup
Splits the single Library page into two distinct routes, redesigns the artist detail header, adds Wikipedia bios, persists view mode in localStorage, surfaces artist photos on cards/rows, and strips all-caps from headers across the app.
Routes
| Before | After |
|---|---|
/ (Library, with Type toggle) |
/ (Albums) — Type toggle dropped |
/?type=artists |
/artists (no source toggle) |
/artists → 308 redirect to /?type=artists
|
/artists is the real page |
/artist/[key] |
unchanged URL, redesigned hero |
Nav becomes Albums | Artists | Random | Batch. Artists nav entry highlights on /artist/[key] too.
What changes
-
/artistsdrops the source toggle. Artists are inherently cross-source —pendingCount + sortedCountis the relevant number on every row. This fixes the bug where rows showed0because the inherited source toggle defaulted to Unsorted while every album was on the sorted side.ArtistCard/ArtistListRownow accept an optionalsourceprop; omitting it (the new page does) shows combined totals. -
View-mode persists per page via a new
$lib/stores/viewMode.tsfactory. Keys:library.albums.view,library.artists.view. Albums can be in List while Artists is in Grid (or vice versa). -
Artist cards and list rows now render the cached
/api/artist-art/[key]portrait with the existing person icon as theonerrorfallback. ArtistCard uses a 48px circle; ArtistListRow gets a 32px circle inline with the artist name. -
/artist/[key]hero redesign:- Portrait bumped from
w-24(96px) tow-28(112px) — about 17%, matching the user's "about 10%" direction. Stays circular. - Row uses
items-centerso the larger portrait and the text hang together. - Title bumps to
text-3xl. - Back link moves out of the hero to a standalone
← Artistslink above it. - Sorted section now renders above Unsorted (prior order reversed per user direction — the user's catalog is sorted-dominant, so leading with that is more useful).
- Bio paragraph rendered below the hero when Wikipedia matched, with a
More on Wikipedia →link.
- Portrait bumped from
-
Wikipedia bio fetch:
- New
src/lib/server/api/wikipedia.tshitshttps://en.wikipedia.org/api/rest_v1/page/summary/<name>. - Music-keyword heuristic on the article's short description prevents disambiguation pages and non-musician collisions from polluting the bio cache.
- Five new columns on
artists(bio / bio_url / bio_source / bio_fetched_at / bio_attempted_at). Independent 7-day back-off so a Wikipedia 404 doesn't share a retry clock with the photo fetch. - Hooked into the same sorted-scan loop that fetches photos — both run in parallel inside the 5-concurrency queue, so wall time grows by
max(photo, bio)per artist rather than the sum. Independent log tallies.
- New
-
Casing cleanup: stripped
uppercase tracking-wideeverywhere in the codebase. Affected files:AlbumTable.svelte,FileList.svelte,SortedAlbumPanel.svelte,batch/+page.svelte,settings/+page.svelte,artist/[key]/+page.svelte. Beets job statuses and log levels keep their dynamic source strings but rendercapitalize.
Verification
-
pnpm run buildpasses. - Visit
/— Albums page, no Type toggle. Source toggle still works. View toggle persists across reloads. - Switch view on
/to List. Visit/artists— that page stays in its own default until you toggle it (independent persistence). - Artists page shows non-zero counts for artists with sorted albums. Cards and rows render real portraits where cached, fallback icon otherwise.
- Visit
/artist/<known-artist>— portrait is visibly larger (~112px), title istext-3xl, back link reads← Artists. Sorted section renders above Unsorted. If Wikipedia matched, a 2–3 line bio sits under the hero with aMore on Wikipedia →link at the end. - No
text-uppercase/uppercasetext anywhere — verify artist detail table headers, section labels, settings page, batch page. - Trigger a manual scan; logs show both
Artist photos:andArtist bios:tallies. Subsequent scans show highbacked-offcounts for both kinds. - Wikipedia API unreachable: bio fetch logs a warning, page still renders without the bio paragraph.
Notes
- Bio fetch is tied to the sorted scan (same as photos). Unsorted-only artists won't get a bio until they appear on the sorted side. Mirrors the existing photo pattern.
- The Wikipedia music-keyword heuristic is conservative — it might miss bios for very obscure or non-English-described artists. The cost of a false negative (no bio) is much lower than a false positive (a politician's bio on a musician's page), so the heuristic prefers caution.