From e1ba152a38dcb35e8a0552a99471e7f95913ed42 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 7 Aug 2024 13:08:54 -0400 Subject: [PATCH] Reduce noise in logs when pre-caching artwork --- core/artwork/cache_warmer.go | 4 ++-- core/artwork/sources.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/artwork/cache_warmer.go b/core/artwork/cache_warmer.go index e09439665..f68db1a96 100644 --- a/core/artwork/cache_warmer.go +++ b/core/artwork/cache_warmer.go @@ -121,7 +121,7 @@ func (a *cacheWarmer) processBatch(ctx context.Context, batch []model.ArtworkID) input := pl.FromSlice(ctx, batch) errs := pl.Sink(ctx, 2, input, a.doCacheImage) for err := range errs { - log.Warn(ctx, "Error warming cache", err) + log.Debug(ctx, "Error warming cache", err) } } @@ -131,7 +131,7 @@ func (a *cacheWarmer) doCacheImage(ctx context.Context, id model.ArtworkID) erro r, _, err := a.artwork.Get(ctx, id, consts.UICoverArtSize, false) if err != nil { - return fmt.Errorf("error caching id='%s': %w", id, err) + return fmt.Errorf("caching id='%s': %w", id, err) } defer r.Close() _, err = io.Copy(io.Discard, r) diff --git a/core/artwork/sources.go b/core/artwork/sources.go index 984b7907f..625f0e420 100644 --- a/core/artwork/sources.go +++ b/core/artwork/sources.go @@ -37,7 +37,7 @@ func selectImageReader(ctx context.Context, artID model.ArtworkID, extractFuncs } log.Trace(ctx, "Failed trying to extract artwork", "artID", artID, "source", f, "elapsed", time.Since(start), err) } - return nil, "", fmt.Errorf("could not get a cover art for %s: %w", artID, ErrUnavailable) + return nil, "", fmt.Errorf("could not get `%s` cover art for %s: %w", artID.Kind, artID, ErrUnavailable) } type sourceFunc func() (r io.ReadCloser, path string, err error)