helliun commited on
Commit
157194d
·
verified ·
1 Parent(s): e329fda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -36,7 +36,7 @@ def set_button_visibility(params):
36
  return gr.update(visible=True), params
37
 
38
 
39
- def create_spotify_playlist_from_df(df, user_id="", params={}, playlist_name="Song Ranker Top Songs"):
40
  # Assuming auth_manager is a SpotifyOAuth instance with the appropriate scope
41
  global auth_manager
42
  token_info = auth_manager.get_access_token(params["code"])
@@ -63,7 +63,7 @@ def create_spotify_playlist_from_df(df, user_id="", params={}, playlist_name="So
63
  track_uris = []
64
 
65
  # Search for each track and collect URIs
66
- for index, row in df.iterrows():
67
  query = f"track:{row['song_title']} artist:{row['artist']}"
68
  search_result = sp.search(query, type='track', limit=1)
69
  tracks = search_result['tracks']['items']
 
36
  return gr.update(visible=True), params
37
 
38
 
39
+ def create_spotify_playlist_from_df(df, user_id="", params={}, playlist_name="Song Ranker Top 100 Songs"):
40
  # Assuming auth_manager is a SpotifyOAuth instance with the appropriate scope
41
  global auth_manager
42
  token_info = auth_manager.get_access_token(params["code"])
 
63
  track_uris = []
64
 
65
  # Search for each track and collect URIs
66
+ for index, row in list(df.iterrows())[:100]:
67
  query = f"track:{row['song_title']} artist:{row['artist']}"
68
  search_result = sp.search(query, type='track', limit=1)
69
  tracks = search_result['tracks']['items']