Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last.fm support #138

Open
5 tasks
aquelemiguel opened this issue Feb 8, 2022 · 9 comments
Open
5 tasks

Last.fm support #138

aquelemiguel opened this issue Feb 8, 2022 · 9 comments
Assignees
Labels
✨ feature New feature or request

Comments

@aquelemiguel
Copy link
Owner

aquelemiguel commented Feb 8, 2022

  • Add support for Last.fm's API
  • Explore the rustfm-scrobble crate
  • Auto-scrobbling for users connected to the same voice channel as the bot
  • Show error message if the Last.fm API key environment variable isn't set
  • Add /lastfm register command to allow Parrot to automatically scrobble for this user
@aquelemiguel aquelemiguel added the ✨ feature New feature or request label Feb 8, 2022
@afonsojramos
Copy link
Collaborator

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.

@afonsojramos
Copy link
Collaborator

If that's okay, I'd like to start looking into this issue @aquelemiguel.

@aquelemiguel
Copy link
Owner Author

@afonsojramos Sure. ☺️

@Educorreia932
Copy link

Educorreia932 commented May 10, 2023

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

@afonsojramos
Copy link
Collaborator

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 🤔

@Educorreia932
Copy link

Educorreia932 commented May 15, 2023

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.

@afonsojramos
Copy link
Collaborator

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).

@Educorreia932
Copy link

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

@afonsojramos
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants