Fix condition to check song duration for scrobbling

Changed from <= to < to ensure the scrobbling of a track that is exactly the duration of MinScrobbleDuration. Also ensures that MinScrobbleDuration = 0 will always lead to a scrobble, as a track with a duration of 0 (which I didn't think of) would otherwise be skipped.
This commit is contained in:
Timo 2026-10-13 12:40:36 +02:00 committed by GitHub
parent 0dcc709743
commit b39d25d2d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -388,7 +388,7 @@ func (l *lastfmAgent) Scrobble(ctx context.Context, userId string, s scrobbler.S
return errors.Join(err, scrobbler.ErrNotAuthorized)
}
if s.Duration <= float32(conf.Server.LastFM.MinScrobbleDuration.Seconds()) {
if s.Duration < float32(conf.Server.LastFM.MinScrobbleDuration.Seconds()) {
log.Debug(ctx, "Skipping Last.fm scrobble for short song", "track", s.Title, "duration", s.Duration)
return nil
}