Refactor audio feat graph
Fixes #51. Instead of passing in an array of hard coded values as the interval end points, an object specifying the beginning, the end, and the step size is used. Categories can be more easily defined and modified this way.
This commit is contained in:
@@ -170,7 +170,7 @@ def add_artist_genres(headers, artist_objs):
|
||||
params = {'ids': artist_ids}
|
||||
artists_response = requests.get('https://api.spotify.com/v1/artists/',
|
||||
headers=headers,
|
||||
params={'ids': artist_ids},
|
||||
params=params,
|
||||
).json()['artists']
|
||||
for i in range(len(artist_objs)):
|
||||
if len(artists_response[i]['genres']) == 0:
|
||||
|
||||
@@ -166,8 +166,9 @@ def get_audio_feature_data(request, audio_feature, user_secret):
|
||||
|
||||
# get_genre_data {{{ #
|
||||
|
||||
|
||||
def get_genre_data(request, user_secret):
|
||||
"""Return genre data needed to create the graph user.
|
||||
"""Return genre data needed to create the graph
|
||||
TODO
|
||||
"""
|
||||
user = User.objects.get(secret=user_secret)
|
||||
|
||||
Reference in New Issue
Block a user