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:
Chris Shyi
2018-06-30 17:59:34 -04:00
parent 98151e19d2
commit fc6c30ec32
5 changed files with 39 additions and 27 deletions

View File

@@ -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:

View File

@@ -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)