feat(valuation): enrich the linked searched artist's avatar + followers (chat#1881 P1 / 2a)
What
Item 2a (š P1) of chat#1881. Funnel-claimed artists render with a blank avatar and "0 followers"; this populates real profile data on claim so the user can confirm we matched the right artist.
How
When the valuation flow links the searched Spotify artist (item 1b), it now also calls a best-effort enrichSearchedArtistProfile:
- sets the artist's avatar (
account_info.image) from the Spotify profile image, and - upserts its Spotify social (
socials) withavatar/followerCount/usernamefrom the resolved profile.
Best-effort ā a failed enrichment never fails the claim (mirrors the surrounding valuation best-effort pattern).
Tests (TDD redāgreen)
enrichSearchedArtistProfile3/3 (sets avatar + upserts social with followers; null-avatar case still upserts; never throws).linkSearchedArtistToAccountupdated to assert the enrichment call. Fulllib/valuation+lib/catalog79/79; eslint clean.
Stacking / merge order
Stacked on item 1b (api#777) ā this PR is based on that branch so the diff shows only the enrichment. Merge #777 first, then this retargets to main. Preview-verification (real avatar/followers appear on /artists after a funnel claim) is pending, gated on 1b being live. Tracking: chat#1881.
Summary by cubic
Populate real avatars and follower counts for funnel-claimed artists so roster and verify-socials donāt show blanks or ā0 followers.ā Enrichment now runs for both canonical and fallback links and normalizes the Spotify profile_url so updates land on the linked social (chat#1881 P1/2a).
-
New Features
- Added
enrichSearchedArtistProfileto setaccount_info.imageand upsert the Spotify social withavatar,followerCount, andusername. - Centralized enrichment in
runValuationHandler: resolve the searched Spotify profile once and enrich whichever artist lands on the roster;linkSearchedArtistToAccountis link-only (takesartistName).
- Added
-
Bug Fixes
- Normalize the Spotify
profile_urlwithnormalizeProfileUrlto matchupdateArtistSocialsand avoid orphan upserts. - Run enrichment on the canonical path too (not just fallback), so real avatar/followers appear after claims.
- Normalize the Spotify
Summary by CodeRabbit
-
New Features
- Newly linked artist profiles are enriched with their Spotify profile image, follower count, profile URL, and username.
- Spotify social information is automatically added when available.
-
Bug Fixes
- Profile enrichment failures no longer interrupt the artist-linking process.