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 <noreply@anthropic.com>
This commit is contained in:
Kris AndersonandClaude Opus 5.5 authored and GitHub committed 2026-11-23 21:17:46 -05:00
1 parent 06df4a5661
commit fbcd90f0ee
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
}
}