Made minor fixes to docstrings

This commit is contained in:
Chris Shyi
2018-07-01 21:09:30 -04:00
parent 01759c59b3
commit 6665532fea
2 changed files with 6 additions and 6 deletions

View File

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

View File

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