Spaces:
Runtime error
Runtime error
Update app_utils.py
Browse files- app_utils.py +8 -1
app_utils.py
CHANGED
@@ -74,7 +74,7 @@ def new_get_client(session):
|
|
74 |
sp = spotipy.Spotify(auth_manager=auth_manager)
|
75 |
user_id = sp.me()['id']
|
76 |
|
77 |
-
return sp, user_id
|
78 |
|
79 |
|
80 |
def extract_uris_from_links(links, url_type):
|
@@ -141,6 +141,13 @@ def aggregate_genres(genres, legit_genres, verbose=False):
|
|
141 |
genres_output[best_match] += genres[glabel]
|
142 |
else:
|
143 |
genres_output[best_match] = genres[glabel]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
return genres_output
|
145 |
|
146 |
def get_all_playlists_uris_from_users(sp, user_ids):
|
|
|
74 |
sp = spotipy.Spotify(auth_manager=auth_manager)
|
75 |
user_id = sp.me()['id']
|
76 |
|
77 |
+
return sp, user_id, auth_manager
|
78 |
|
79 |
|
80 |
def extract_uris_from_links(links, url_type):
|
|
|
141 |
genres_output[best_match] += genres[glabel]
|
142 |
else:
|
143 |
genres_output[best_match] = genres[glabel]
|
144 |
+
else:
|
145 |
+
if "unknown" in genres_output.keys():
|
146 |
+
genres_output["unknown"] += genres[glabel]
|
147 |
+
else:
|
148 |
+
genres_output["unknown"] = genres[glabel]
|
149 |
+
for k in genres_output.keys():
|
150 |
+
genres_output[k] = sorted(set(genres_output[k]))
|
151 |
return genres_output
|
152 |
|
153 |
def get_all_playlists_uris_from_users(sp, user_ids):
|