From b8ab83ae63fe538a67fb9ad7e255afc505dc9ee0 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 8 Sep 2021 22:20:25 -0400 Subject: [PATCH] Minor bugfixes: - Playlist creation didn't correctly yield the ID of the new playlist - Albums with more than a single page of tracks would yield the results directly, rather than a pager --- spotify_actions/album.py | 2 +- spotify_actions/playlist.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spotify_actions/album.py b/spotify_actions/album.py index ddf6bd6..7d8104a 100644 --- a/spotify_actions/album.py +++ b/spotify_actions/album.py @@ -47,7 +47,7 @@ def album_to_tracks(client: Spotify, albums: Iterable[SimplifiedAlbum]) -> Itera # Because most album tracklists don't need to use paging, it's expected that API calls are relatively infrequent for album in albums: - tracks_function = partial(client.album_tracks, album_id=album.spotify_id) + tracks_function = partial(_album_tracks, album_id=album.spotify_id) for track in exhaust(tracks_function, album.tracks): yield SimplifiedTrack(**track) diff --git a/spotify_actions/playlist.py b/spotify_actions/playlist.py index ba787d8..de5a10f 100644 --- a/spotify_actions/playlist.py +++ b/spotify_actions/playlist.py @@ -54,7 +54,7 @@ def playlist_current_user_assure( if not found: current_user_id = user_current(client).spotify_id - playlist_create(client, current_user_id, name) + yield playlist_create(client, current_user_id, name) def playlist_replace(