Open aquelemiguel opened 2 years ago
Depending on how the /lastfm register
will work, we will likely need to save some sort of token.
It is not required, but we should take care of #124 before this.
If that's okay, I'd like to start looking into this issue @aquelemiguel.
@afonsojramos Sure. ☺️
I don't know if any progress had been made, but I started working on this feature in a separate fork
Currently it's scrobbling the played track for users listening to it and with their Last.fm account registered in the bot
Registration is made by providing a temporary token to the bot so that it generates a session key for that user, which is then stored in GuildSettings
I'm not sure how and when to trigger the scrobbling. It should be 30 seconds into a track, so a delayed event would do, but things like pausing/resuming the track or ending the track sooner would have to be taken into account
I'll pass on the torch to you then @Educorreia932!
Why do you say "It should be 30 seconds into a track"? On Spotify it starts tracking as soon as I skip into the song 🤔
Why do you say "It should be 30 seconds into a track"? On Spotify it starts tracking as soon as I skip into the song thinking
Apparently the conditions to scrobble a track are slightly different. According to Last.fm documentation:
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.)
Although, these are just guidelines, nothing prevents the track from being scrobbled as soon as the track is played.
For an initial implementation we can focus on implementing just the start listening and ignoring the pausing of tracks (assuming that Last.FM finishes the track after its full duration).
There is a problem. To scrobble a track, both artist and title are required, although I don't know if currently we have that information when playing from YouTube
That is, indeed, the source of the issue with this. Not everything that plays is music, and when it is music, the music might not even exist on Last.FM. So some parsing will need to be made to figure out the artist and match it to the artist on LastFM.
/lastfm register
command to allow Parrot to automatically scrobble for this user