Require wall-clock elapsed time before scrobbling
Summary
- Adds a real-time elapsed check alongside the audio position threshold in
onTimeUpdate - Prevents premature scrobbles caused by stale
timeupdateevents when switching tracks (race condition where the old track's highcurrentTimefires after the new track resetsscrobbleSent) - Enforces a 30-second minimum listen time per Last.fm guidelines
Test plan
-
Play a track briefly and skip — should NOT appear as a scrobble on Last.fm -
Play a track past 50% duration — should scrobble normally -
Switch tracks rapidly — no spurious scrobbles for the new track