Skip to content

Require wall-clock elapsed time before scrobbling

jedmund requested to merge jedmund/delay-scrobble into main

Summary

  • Adds a real-time elapsed check alongside the audio position threshold in onTimeUpdate
  • Prevents premature scrobbles caused by stale timeupdate events when switching tracks (race condition where the old track's high currentTime fires after the new track resets scrobbleSent)
  • 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

🤖 Generated with Claude Code

Merge request reports

Loading