fix: sync first playlists page
This commit: 1e8366a0e8 broke the loading of playlists. The first results coming back from the Spotify API were not being added to the playlists array.
This commit is contained in:
@@ -296,6 +296,7 @@ async def get_playlists_from_spotify(spotify_session: spotipy.Spotify, config):
|
|||||||
print("Loading Spotify playlists")
|
print("Loading Spotify playlists")
|
||||||
results = spotify_session.user_playlists(config['spotify']['username'])
|
results = spotify_session.user_playlists(config['spotify']['username'])
|
||||||
exclude_list = set([x.split(':')[-1] for x in config.get('excluded_playlists', [])])
|
exclude_list = set([x.split(':')[-1] for x in config.get('excluded_playlists', [])])
|
||||||
|
playlists.extend([p for p in results['items'] if p['owner']['id'] == config['spotify']['username'] and not p['id'] in exclude_list])
|
||||||
|
|
||||||
# get all the remaining playlists in parallel
|
# get all the remaining playlists in parallel
|
||||||
if results['next']:
|
if results['next']:
|
||||||
|
|||||||
Reference in New Issue
Block a user