Obtain Spotify track (popularity and audio features) attributes - #4351
Obtain Spotify track (popularity and audio features) attributes#4351arsaboo wants to merge 58 commits into
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 spotifysyncto obtain all the audio features available for a track. This includes thepopularityinformation andaudio_features. The followingaudio_featuresare 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 importwhich 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.rstnear the top of the document.)