From fbcd90f0ee3b403faad643c19afdc19efda67d66 Mon Sep 17 00:00:00 2001 From: Kris Anderson <1562427+kris-anderson@users.noreply.github.com> Date: Mon, 23 Nov 2026 18:17:46 -0800 Subject: [PATCH] fix(scrobbler): log a failed now-playing update once, at warn (#6530) A failed now-playing call was logged twice: at warn by the ListenBrainz or Last.fm agent, then at error by dispatchNowPlaying. Now-playing updates are not retried and the next one replaces them, so a dropped update is not an error. Log it at warn in dispatchNowPlaying and move the agents' own lines to debug. Plugin scrobblers don't log the error themselves, so the worker's warn stays their only line. Agreed in #6522. Signed-off-by: Kris Anderson <1562427+kris-anderson@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- adapters/lastfm/agent.go | 2 +- adapters/listenbrainz/agent.go | 2 +- core/scrobbler/nowplaying_worker.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adapters/lastfm/agent.go b/adapters/lastfm/agent.go index 7208c8852..e08b52285 100644 --- a/adapters/lastfm/agent.go +++ b/adapters/lastfm/agent.go @@ -377,7 +377,7 @@ func (l *lastfmAgent) NowPlaying(ctx context.Context, userId string, track *mode albumArtist: l.getArtistForScrobble(track, model.RoleAlbumArtist, track.AlbumArtist), }) if err != nil { - log.Warn(ctx, "Last.fm client.updateNowPlaying returned error", "track", track.Title, err) + log.Debug(ctx, "Last.fm client.updateNowPlaying returned error", "track", track.Title, err) return errors.Join(err, scrobbler.ErrUnrecoverable) } return nil diff --git a/adapters/listenbrainz/agent.go b/adapters/listenbrainz/agent.go index 831b0740d..8d78a7014 100644 --- a/adapters/listenbrainz/agent.go +++ b/adapters/listenbrainz/agent.go @@ -80,7 +80,7 @@ func (l *listenBrainzAgent) NowPlaying(ctx context.Context, userId string, track li := l.formatListen(track) err = l.client.updateNowPlaying(ctx, sk, li) if err != nil { - log.Warn(ctx, "ListenBrainz updateNowPlaying returned error", "track", track.Title, err) + log.Debug(ctx, "ListenBrainz updateNowPlaying returned error", "track", track.Title, err) return errors.Join(err, scrobbler.ErrUnrecoverable) } return nil diff --git a/core/scrobbler/nowplaying_worker.go b/core/scrobbler/nowplaying_worker.go index 1bacec689..60017e411 100644 --- a/core/scrobbler/nowplaying_worker.go +++ b/core/scrobbler/nowplaying_worker.go @@ -71,7 +71,7 @@ func (p *playTracker) dispatchNowPlaying(ctx context.Context, userId string, t * log.Debug(ctx, "Sending NowPlaying update", "scrobbler", name, "track", t.Title, "artist", t.Artist, "position", position) err := s.NowPlaying(ctx, userId, t, position) if err != nil { - log.Error(ctx, "Error sending PlaybackSession", "scrobbler", name, "track", t.Title, "artist", t.Artist, err) + log.Warn(ctx, "Error sending PlaybackSession", "scrobbler", name, "track", t.Title, "artist", t.Artist, err) continue } }