From bb1a3edbad9bb32c3b146f6e065454c907fc6513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Winkelk=C3=B6tter?= Date: Fri, 21 Aug 2026 10:54:12 +0000 Subject: [PATCH] fix(lastfm): only send duration to LastFM if song is above 30s, otherwise omit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timo Winkelkötter --- adapters/lastfm/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adapters/lastfm/client.go b/adapters/lastfm/client.go index 726df1360..3d8990ecc 100644 --- a/adapters/lastfm/client.go +++ b/adapters/lastfm/client.go @@ -171,7 +171,11 @@ func (c *client) scrobble(ctx context.Context, sessionKey string, info ScrobbleI params.Add("album", info.album) params.Add("trackNumber", strconv.Itoa(info.trackNumber)) params.Add("mbid", info.mbid) - params.Add("duration", strconv.Itoa(info.duration)) + if info.duration >= 30 { + params.Add("duration", strconv.Itoa(info.duration)) + } else { + log.Debug(ctx, "LastFM: scrobble duration is less than 30 seconds, duration will not be transmitted", "duration", info.duration) + } params.Add("albumArtist", info.albumArtist) params.Add("sk", sessionKey) resp, err := c.makeRequest(ctx, http.MethodPost, params, true)