feat(v3 library): searchable Cover Art Archive picker in Change-cover#783
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a MusicBrainz-backed cover search feature: a backend helper and endpoint that search Cover Art Archive release-groups and return candidate covers, plus frontend image-picker UI wiring that fetches and applies search results, prefilled using artist/album metadata passed from calling screens. ChangesCover Search Feature
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SongsUI as songs.js / match-review.js
participant ImagePicker as image-picker.js
participant Server as server.py
participant MusicBrainz
User->>SongsUI: Click "Change cover..."
SongsUI->>ImagePicker: __fbOpenImagePicker(filename, title, artist, album)
ImagePicker->>ImagePicker: compute _cur.query from artist/album
User->>ImagePicker: Click Search / press Enter
ImagePicker->>Server: GET /art/cover-search?q=query
Server->>Server: derive query if q empty (pack metadata)
Server->>MusicBrainz: _mb_search_release_groups(query)
MusicBrainz-->>Server: release-groups results
Server-->>ImagePicker: {query, covers}
ImagePicker->>ImagePicker: render cover tiles
User->>ImagePicker: Click a cover tile
ImagePicker->>ImagePicker: apply('url', selectedCover)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
📋 Merge order — metadata-curation epic (7 PRs)
#778–#780 are stacked (each based on the branch above), so GitHub re-points each to
|
c56997a to
d025002
Compare
The cover picker only offered CAA covers from a song's MATCHED release, so an
unmatched song (the city-pop pile) got nothing but Current/Pack/Upload/URL. Add
a search box: GET /api/song/{fn}/art/cover-search?q= searches MusicBrainz
release-groups and returns each album's CAA front-250 thumb; the picker renders
them as pickable tiles (same apply→/art/url path; covers with no CAA art
self-hide). Pre-filled from the song's artist + album/title (romaji fallback), so
a blank-artist pack pre-fills "Junko Yagami …". Reuses the throttled _mb_http_get.
d45cdc3 to
152d786
Compare
Adds a search box to the Change-cover picker so you can find an album cover even for a song with no metadata match (stacked on #782 → the metadata-curation capstone).
The gap
/art/candidatesonly offers CAA covers from a song's matched release — so the ~640 unmatched city-pop packs got nothing but Current / Pack / Upload / Paste-URL.The fix
GET /api/song/{fn}/art/cover-search?q=→_mb_search_release_groups(q)searches MusicBrainz/release-group(reusing the throttled_mb_http_get) and maps each album to its Cover Art Archive front thumb (coverartarchive.org/release-group/{id}/front-250).qdefaults to the song's own artist + album/title (with the romaji fallback applied), so a blank-artist pack pre-fills a sensible query./art/urlpath. Albums with no CAA art self-hide (imgonerror), same as the auto candidates. The three__fbOpenImagePickercallers now passartist/albumfor the pre-fill.Verified live
Default query "Junko Yagami BAY CITY" → 8 albums; the thumbs resolve to real images (
200 image/jpeg). Read-only search; a pick reuses the existing reversible art-override route (files untouched).Known limitation: MusicBrainz release-group text search is fuzzy, so a few unrelated albums can appear — you pick the right one visually by its cover (the natural cover-picker interaction). Can tighten to an artist-constrained query if it proves noisy.
Stacked on #782.
node --checkclean across the three touched modules;server.pyparses.🤖 Generated with Claude Code
Summary by CodeRabbit