fix: simplify artist image provider, remove unnecessary LookupArtist call
The previous implementation called LookupArtist (rate-limited MB API) before fetching url-rels, wasting a rate limiter slot. The fetchURL for rels also bypassed the MB rate limiter, risking 503 rejections. Rewrite: fetch MB url-rels once (direct HTTP, cached 30 days), parse both image and wikidata relations from the same response, resolve Wikimedia thumb URL. No dependency on MusicBrainzClient — just the Cache for storage and a plain http.Client. Also cleared 34 stale cached empty results from previous failed resolution attempts that were blocking image lookup.
This commit is contained in:
@@ -38,7 +38,7 @@ func NewExploreService(logger *slog.Logger, db *database.DB) *Service {
|
||||
lb := NewListenBrainzClient(limiter, cache, logger.WithGroup("listenbrainz"))
|
||||
index := NewSearchIndex(db, lb, logger.WithGroup("search-index"))
|
||||
artProxy := NewCoverArtProxy(db, limiter)
|
||||
artistImg := NewArtistImageProvider(mb, cache, logger.WithGroup("artist-image"))
|
||||
artistImg := NewArtistImageProvider(cache, logger.WithGroup("artist-image"))
|
||||
|
||||
logger.Info("explore service created")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user