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

Support LastFm scrobbling #91

Closed
himynameisjonas opened this issue Mar 1, 2015 · 2 comments
Closed

Support LastFm scrobbling #91

himynameisjonas opened this issue Mar 1, 2015 · 2 comments
Milestone

Comments

@himynameisjonas
Copy link

I would be nice if the sp_session_set_social_credentials method was available from the node api so we can scrobble played tracks to LastFm.

@FrontierPsychiatrist
Copy link
Owner

Yup, good idea.

FrontierPsychiatrist added a commit that referenced this issue Jun 22, 2016
Implements #91.

Allows access to the `sp_session_is_scrobbling`,
`sp_session_is_scrobbling_possible`, `sp_session_set_scrobbling` and
`sp_session_set_social_credentials` methods via the `spotify` object.

Adds the needed constants.
@FrontierPsychiatrist
Copy link
Owner

Added to development, will be released with 0.8.0.

Added the following:

spotify.constants = {
   //...
   SOCIAL_PROVIDER_SPOTIFY: ...,
   SOCIAL_PROVIDER_FACEBOOK: ...,
   SOCIAL_PROVIDER_LASTFM: ...,

   SCROBBLING_STATE_USE_GLOBAL_SETTING: ...,
   SCROBBLING_STATE_LOCAL_ENABLED: ...,
   SCROBBLING_STATE_LOCAL_DISABLED: ...,
   SCROBBLING_STATE_GLOBAL_ENABLED: ...,
   SCROBBLING_STATE_GLOBAL_DISABLED: ...,
   //...
}

/**
 * Takes one of spotify.constants.SOCIAL_PROVIDER_*
 * Returns one of spotify.constants.SCROBBLING_STATE_*
*/
spotify.isScrobbling(provider);

/**
 * Currently only accepts spotify.constants.SOCIAL_PROVIDER_FACEBOOK (see libspotify)
 * Returns a boolean signifying if scrobbling is possible
*/
spotify.isScrobblingPossible(provider);

/**
 * Takes one of spotify.constants.SOCIAL_PROVIDER_* and spotify.constants.SCROBBLING_STATE_LOCAL*
 *   Only the local settings are allowed!
*/
spotify.setScrobbling(provider, state);

/**
 * Takes one of spotify.constants.SOCIAL_PROVIDER_*
 * Only needed for last.fm if I get the libspotify documentation correctly
*/
spotify.setSocialCredentials(provider, username, password);

As always, only use these after logging in.

I'm not completely sure about the difference between LOCAL and GLOBAL scrobbling settings, I guess there are settings somewhere in the user profile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants