mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
Merge pull request #4380 from arsaboo/spotify_types
Define item_types for Spotify attributes to enable queries
This commit is contained in:
commit
fd65e12c8f
1 changed files with 17 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import requests
|
|||
import unidecode
|
||||
from beets import ui
|
||||
from beets.autotag.hooks import AlbumInfo, TrackInfo
|
||||
from beets.dbcore import types
|
||||
from beets.plugins import BeetsPlugin, MetadataSourcePlugin
|
||||
|
||||
DEFAULT_WAITING_TIME = 5
|
||||
|
|
@ -37,6 +38,22 @@ DEFAULT_WAITING_TIME = 5
|
|||
class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
|
||||
data_source = 'Spotify'
|
||||
|
||||
item_types = {
|
||||
'spotify_track_popularity': types.INTEGER,
|
||||
'spotify_acousticness': types.FLOAT,
|
||||
'spotify_danceability': types.FLOAT,
|
||||
'spotify_energy': types.FLOAT,
|
||||
'spotify_instrumentalness': types.FLOAT,
|
||||
'spotify_key': types.FLOAT,
|
||||
'spotify_liveness': types.FLOAT,
|
||||
'spotify_loudness': types.FLOAT,
|
||||
'spotify_mode': types.INTEGER,
|
||||
'spotify_speechiness': types.FLOAT,
|
||||
'spotify_tempo': types.FLOAT,
|
||||
'spotify_time_signature': types.INTEGER,
|
||||
'spotify_valence': types.FLOAT,
|
||||
}
|
||||
|
||||
# Base URLs for the Spotify API
|
||||
# Documentation: https://developer.spotify.com/web-api
|
||||
oauth_token_url = 'https://accounts.spotify.com/api/token'
|
||||
|
|
|
|||
Loading…
Reference in a new issue