You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just got hit by a radio station playing lots of snippets of songs in succession.
At least one method of validation is not to scrobble until at least 30 seconds have elapsed. If a new track has come in from Shazam in those 30 seconds, then don't scrobble.
You can (and it'd be a great addition) to send a now playing notification as soon as a track starts playing, but wait on the scrobble one until later.
For reference:
For every track a user listens to the client should send a track.updateNowPlaying request and a track.scrobble request. ...
The "Now Playing" service lets a client notify Last.fm that a user has started listening to a track. This does not affect a user's charts, but will feature the current track on their profile page, along with an indication of what music player they're using. ...
A track should only be scrobbled when the following conditions have been met:
The track must be longer than 30 seconds.
And the track has been played for at least half its duration, or for 4 minutes (whichever occurs earlier.)
As soon as these conditions have been met, the scrobble request may be sent at any time. It is often most convenient to send a scrobble request when a track has finished playing.
The thing is that Shazam only sends one notification per song, no matter how long the song has been played. So this is not about the Last.fm API.
The solution suggested on the README needs to be tested.
How to make sure that the song tagged by Shazam was longer than 30 seconds?
TODO: reset Shazam tags after each tag, then get the same tag again and again until we know if the song were played long enough.
TODO: reset Shazam tags after each tag, then get the same tag again and again until we know if the song were played long enough.
Does that mean wiping the list of songs in the Shazam drop down? Would people find it annoying? Shazam might not like it.
The thing is that Shazam only sends one notification per song, no matter how long the song has been played. So this is not about the Last.fm API.
Agreed. All we know is:
A track started.
Either:
another new track started within 30 seconds
no new track started within 30 seconds
Pseudocode:
-> new track notification:
time_track_started = now
lastfm.set_now_playing(track)
wait up to 30 seconds...
if no new track notification in 30 seconds:
lastfm.set_scrobbled(track)
if new track notification in less than 30 seconds:
# don't scrobble (track)
# go back to the top
I just got hit by a radio station playing lots of snippets of songs in succession.
At least one method of validation is not to scrobble until at least 30 seconds have elapsed. If a new track has come in from Shazam in those 30 seconds, then don't scrobble.
You can (and it'd be a great addition) to send a now playing notification as soon as a track starts playing, but wait on the scrobble one until later.
For reference:
http://www.last.fm/api/scrobbling
The text was updated successfully, but these errors were encountered: