Browse Source

Made minor fixes to docstrings

master
Chris Shyi 7 years ago
parent
commit
6665532fea
  1. 9
      api/utils.py
  2. 1
      api/views.py

9
api/utils.py

@ -135,11 +135,11 @@ def get_audio_features(headers, track_objs):
# process_artist_genre {{{ # # process_artist_genre {{{ #
def process_artist_genre(genre_name, artist_obj): 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. :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 :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]) 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/', artists_response = requests.get('https://api.spotify.com/v1/artists/',
headers=headers, headers=headers,
params=params,
params={'ids': artist_ids},
).json()['artists'] ).json()['artists']
for i in range(len(artist_objs)): for i in range(len(artist_objs)):
if len(artists_response[i]['genres']) == 0: if len(artists_response[i]['genres']) == 0:

1
api/views.py

@ -56,6 +56,7 @@ def parse_library(request, user_secret):
if console_logging: if console_logging:
tracks_processed = 0 tracks_processed = 0
tracks_processed = 0
for track_dict in saved_tracks_response: for track_dict in saved_tracks_response:
# add artists {{{ # # add artists {{{ #

Loading…
Cancel
Save