fix: go back to synchronous image processing

This commit is contained in:
Gabe Farrell 2025-06-12 00:30:01 -04:00
parent aba2b76def
commit 1a5a6acc95
10 changed files with 58 additions and 168 deletions

View file

@ -23,7 +23,6 @@ type AssociateAlbumOpts struct {
ReleaseName string
TrackName string // required
Mbzc mbz.MusicBrainzCaller
IP *ImageProcessor
}
func AssociateAlbum(ctx context.Context, d db.DB, opts AssociateAlbumOpts) (*models.Album, error) {
@ -134,7 +133,7 @@ func createOrUpdateAlbumWithMbzReleaseID(ctx context.Context, d db.DB, opts Asso
}
imgid = uuid.New()
l.Debug().Msg("Downloading album image from source...")
err = opts.IP.EnqueueDownloadAndCache(ctx, imgid, imgUrl, size)
err = DownloadAndCacheImage(ctx, imgid, imgUrl, size)
if err != nil {
l.Err(err).Msg("Failed to cache image")
}
@ -217,7 +216,7 @@ func matchAlbumByTitle(ctx context.Context, d db.DB, opts AssociateAlbumOpts) (*
}
imgid = uuid.New()
l.Debug().Msg("Downloading album image from source...")
err = opts.IP.EnqueueDownloadAndCache(ctx, imgid, imgUrl, size)
err = DownloadAndCacheImage(ctx, imgid, imgUrl, size)
if err != nil {
l.Err(err).Msg("Failed to cache image")
}