mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-18 07:30:29 +00:00
fix(lastfm): only send duration to LastFM if song is above 30s, otherwise omit
Signed-off-by: Timo Winkelkötter <timjimwink@gmail.com>
This commit is contained in:
parent
46e480aa25
commit
bb1a3edbad
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user