-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Obtain Spotify track (popularity and audio features) attributes #4351
Conversation
Nice; thanks for getting this started! What do you think about rolling this new command directly into the existing Spotify plugin? That could avoid a bunch of the duplicated code and allow users to share the token between the two bits of functionality, for example. |
I am not 100% versed with the existing Spotify plugin. It may be possible to combine the features, but I am a little hesitant. The existing plugin is written for the auto-tagger and serves the basic purpose of getting the tag information from Spotify. Also, not everyone may require all these features (although that can be addressed with a config option). Unless you are completely opposed to this idea, it may be a good idea to keep it separate so that additional features can be added here. |
Also note that it will make the importer significantly slow due to the timeouts and the additional processing required. |
Ah, to be clear, I just meant adding this command to the Spotify plugin. That would mean you'd still have to run the command explicitly to fetch the new data; it would not run as part of the import. In the code, this is just a matter of defining the I don't have a strong opinion about whether it's one or two plugins per se, but I do strongly prefer not to duplicate code... and keeping it in one plugin seems most likely to avoid that duplication. |
Is there any plugin template that I can follow? |
closing in favor of #4352 |
This PR introduces a new command
beet spotifysync
to obtain all the audio features available for a track. This includes thepopularity
information andaudio_features
. The followingaudio_features
are included: acousticness, danceability, energy, instrumentalness, key, liveness, loudness, mode, speechiness, tempo, time_signature, valence. See details here.This features only processes tracks that already have the spotify_track_id (which was introduced in #4348). So, the workflow will be to run
beet import
which will populate thespotify_track_id
. This information can then be used to runbeet spotifysync
.Fixes #4347 #3578 #4094
Config required:
My hope is that we get the initial PR so that folks can start using it and improve upon it.
To Do
docs/
to describe it.)docs/changelog.rst
near the top of the document.)