Koito/internal
safierinx-a 2c29499403 Add MusicBrainz search-by-name enrichment for scrobbles without IDs
When a listen arrives with no MBZ IDs and no album title (the common
multi-scrobbler/Last.fm case), search MusicBrainz by artist+track name
to resolve recording, release, and release group IDs. This unlocks
CoverArtArchive album art, proper album association, and duration data.

New file: internal/mbz/search.go
- SearchRecording() method with Lucene query escaping
- Confidence filter: case-insensitive exact match on title + artist credit
- Release selection: prefer Official status, then first available
- Uses existing rate-limited queue (1 req/sec)

Integration in catalog.go:
- Only triggers when RecordingMbzID, ReleaseMbzID, AND ReleaseTitle are
  all missing — no impact on scrobbles that already have MBZ data
- Soft failure — search errors don't block the listen
- KOITO_DISABLE_MUSICBRAINZ handled automatically (MbzErrorCaller returns error)

Interface + mocks updated:
- SearchRecording added to MusicBrainzCaller interface
- MbzMockCaller: SearchResults map for test data
- MbzErrorCaller: returns error (existing pattern)

New tests:
- TestSubmitListen_SearchByName — mock search, verify album+duration resolved
- TestSubmitListen_SearchByNameNoMatch — verify graceful fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 03:02:17 +05:30
..
catalog Add MusicBrainz search-by-name enrichment for scrobbles without IDs 2026-03-27 03:02:17 +05:30
cfg feat: add api key auth to web api (#183) 2026-01-26 13:48:43 -05:00
db fix: correct interest bucket queries (#169) 2026-01-22 17:01:46 -05:00
export feat: v0.0.10 (#23) 2025-06-18 08:48:19 -04:00
images feat: lastfm image support (#166) 2026-01-21 16:03:05 -05:00
importer fix: ensure mbids in mbidmapping are discovered (#180) 2026-01-25 15:51:07 -05:00
logger chore: initial public commit 2025-06-11 19:45:39 -04:00
mbz Add MusicBrainz search-by-name enrichment for scrobbles without IDs 2026-03-27 03:02:17 +05:30
memkv Pre-release version v0.0.14 (#96) 2025-11-19 20:26:56 -05:00
models feat: all time rank display (#149) 2026-01-16 01:03:23 -05:00
repository fix: correct interest bucket queries (#169) 2026-01-22 17:01:46 -05:00
summary fix: use sql rank (#148) 2026-01-15 21:08:30 -05:00
utils fix: respect client timezone for requests (#119) 2026-01-10 01:45:31 -05:00