Skip songs with less than 31 seconds, as per Last.fm specification
See https://www.last.fm/api/scrobbling#when-is-a-scrobble-a-scrobble
This commit is contained in:
@@ -186,6 +186,10 @@ func (l *lastfmAgent) Scrobble(ctx context.Context, userId string, scrobbles []s
|
||||
|
||||
// TODO Implement batch scrobbling
|
||||
for _, s := range scrobbles {
|
||||
if s.Duration <= 30 {
|
||||
log.Debug(ctx, "Skipping Last.fm scrobble for short song", "track", s.Title, "duration", s.Duration)
|
||||
continue
|
||||
}
|
||||
err = l.client.Scrobble(ctx, sk, ScrobbleInfo{
|
||||
artist: s.Artist,
|
||||
track: s.Title,
|
||||
|
||||
Reference in New Issue
Block a user