fix(subsonic): warn when a nowPlaying scrobble sends multiple ids

The scrobble endpoint accepts multiple ids, but a nowPlaying notification
(submission=false) describes a single track, so only the first id is used.
The extra ids were dropped silently, which made client bugs invisible. Log a
warning instead, keeping the existing behavior for clients that rely on it.
This commit is contained in:
Deluan 2026-09-20 22:25:55 -04:00
commit 6b3938b5b6

View file

@ -181,6 +181,9 @@ func (api *Router) Scrobble(r *http.Request) (*responses.Subsonic, error) {
log.Error(ctx, "Error registering scrobbles", "ids", ids, "times", times, err)
}
} else {
if len(ids) > 1 {
log.Warn(ctx, "Multiple ids sent to a nowPlaying notification, only the first one will be used", "ids", ids)
}
err := api.scrobblerNowPlaying(ctx, ids[0], position)
if err != nil {
log.Error(ctx, "Error setting NowPlaying", "id", ids[0], err)