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:
Adria Jimenez
2024-06-06 18:12:40 +08:00
committed by Tim Rae
parent 3e9b2ef0ec
commit ecc642ba7d

View File

@@ -296,6 +296,7 @@ async def get_playlists_from_spotify(spotify_session: spotipy.Spotify, config):
print("Loading Spotify playlists")
results = spotify_session.user_playlists(config['spotify']['username'])
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
if results['next']: