From 8dfd8f842d7c95ff8052427bbc1fbc951c064f35 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 30 Aug 2026 21:46:56 -0400 Subject: [PATCH] chore(lastfm): clearer log when a scrobble is dropped for being too old Last.fm ignore code 3 means the timestamp is older than 14 days; spell that out instead of the generic ignored-scrobble warning. --- adapters/lastfm/client.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/adapters/lastfm/client.go b/adapters/lastfm/client.go index e468aa638..c50a11aeb 100644 --- a/adapters/lastfm/client.go +++ b/adapters/lastfm/client.go @@ -183,9 +183,15 @@ func (c *client) scrobble(ctx context.Context, sessionKey string, info ScrobbleI if err != nil { return err } - if resp.Scrobbles.Scrobble.IgnoredMessage.Code != "0" { - log.Warn(ctx, "LastFM: scrobble was ignored", "code", resp.Scrobbles.Scrobble.IgnoredMessage.Code, - "text", resp.Scrobbles.Scrobble.IgnoredMessage.Text, "info", info) + if code := resp.Scrobbles.Scrobble.IgnoredMessage.Code; code != "0" { + if code == "3" { + // Last.fm rejects scrobbles whose timestamp is older than 14 days; the buffer drops it. + log.Warn(ctx, "LastFM: scrobble dropped, timestamp too old (older than 14 days)", + "code", code, "info", info) + } else { + log.Warn(ctx, "LastFM: scrobble was ignored", "code", code, + "text", resp.Scrobbles.Scrobble.IgnoredMessage.Text, "info", info) + } } if resp.Scrobbles.Attr.Accepted != 1 { log.Warn(ctx, "LastFM: scrobble was not accepted", "code", resp.Scrobbles.Scrobble.IgnoredMessage.Code,