From 6665532feaac3ab8fc300862f1f53ff6e71e05a4 Mon Sep 17 00:00:00 2001 From: Chris Shyi Date: Sun, 1 Jul 2018 21:09:30 -0400 Subject: [PATCH] Made minor fixes to docstrings --- api/utils.py | 9 ++++----- api/views.py | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/utils.py b/api/utils.py index ef0c99f..f2c16b3 100644 --- a/api/utils.py +++ b/api/utils.py @@ -135,11 +135,11 @@ def get_audio_features(headers, track_objs): # process_artist_genre {{{ # def process_artist_genre(genre_name, artist_obj): - """Increase count for correspoding Genre object to genre_name and add that - Genre to artist_obj. + """Increase count for corresponding Genre object to genre_name and associate that + Genre object with artist_obj. :genre_name: Name of genre. - :artist_obj: Artist object to add Genre object to. + :artist_obj: Artist object to associate Genre object with :returns: None """ @@ -167,10 +167,9 @@ def add_artist_genres(headers, artist_objs): """ artist_ids = str.join(",", [artist_obj.id for artist_obj in artist_objs]) - params = {'ids': artist_ids} artists_response = requests.get('https://api.spotify.com/v1/artists/', headers=headers, - params=params, + params={'ids': artist_ids}, ).json()['artists'] for i in range(len(artist_objs)): if len(artists_response[i]['genres']) == 0: diff --git a/api/views.py b/api/views.py index 2f8e96c..5e44c3f 100644 --- a/api/views.py +++ b/api/views.py @@ -56,6 +56,7 @@ def parse_library(request, user_secret): if console_logging: tracks_processed = 0 + tracks_processed = 0 for track_dict in saved_tracks_response: # add artists {{{ # @@ -103,7 +104,7 @@ def parse_library(request, user_secret): offset += USER_TRACKS_LIMIT # clean-up {{{ # - + # update remaining artists without genres and songs without features if # there are any if len(artist_genre_queue) > 0: