Creates internal/musicbrainz/sync.go with SyncArtistDiscography function that orchestrates the full flow: cache check via GetCachedReleases, fetch from MusicBrainz API on cache miss, filter via FilterReleaseGroups, and upsert into external_releases via database.SaveExternalRelease. Includes SyncArtistDiscographyWithFilter variant for per-artist type filtering. All functions support context cancellation. 14 new tests cover cache hit/miss, status/type filtering, context cancellation, idempotency, API errors, and full XML pipeline integration.
3.9 KiB
3.9 KiB