retrieve all continuations when limit parameter is None (closes #300)
Squashed commit of the following:
commit 3f447e39a403bea746b18e79cd7a9177a20ef79c
Merge: 8746a2a c31c8da
Author: Adrian <an3015@nyu.edu>
Date: Sun Sep 25 12:17:44 2022 -0400
Merge branch 'master' of https://github.com/adrinu/ytmusicapi into retrieve-all-playlists
commit 8746a2af5bdc12e5e16a87b6c69d39dde8712390
Author: Adrian <an3015@nyu.edu>
Date: Sun Sep 25 12:17:06 2022 -0400
Limit to other funcs
commit 5b69523003b6d0c2a00e31e1ed4a022efeabee65
Merge: b7a3e75 d36d85d
Author: Adrian <an3015@nyu.edu>
Date: Sun Sep 25 12:07:45 2022 -0400
Merge branch 'retrieve-all-playlists' of https://github.com/Auzzy/ytmusicapi into retrieve-all-playlists
commit c31c8dafae0c805dee68d2df19b3fe1ac454d707
Author: Adrian <an3015@nyu.edu>
Date: Sun Sep 25 11:35:05 2022 -0400
Limit is none implementation
commit 6768f1d66de832c17b5557c910f4b2a353386690
Merge: b7a3e75 d36d85d
Author: Adrian <an3015@nyu.edu>
Date: Sun Sep 25 01:06:59 2022 -0400
Merge branch 'retrieve-all-playlists' of https://github.com/Auzzy/ytmusicapi into retrieve-all-playlists
commit d36d85de9b3dff08a9997ca712817724b01608a3
Author: Austin Noto-Moniz <mathfreak65@gmail.com>
Date: Mon May 30 16:55:53 2022 -0400
get_library_playlists: When limit is None, return them all.
This commit is contained in:
parent
b7a3e7544d
commit
1b94985014
5 changed files with 60 additions and 22 deletions
|
|
@ -34,8 +34,9 @@ def parse_library_albums(response, request_func, limit):
|
|||
|
||||
if 'continuations' in results:
|
||||
parse_func = lambda contents: parse_albums(contents)
|
||||
remaining_limit = None if limit is None else (limit - len(albums))
|
||||
albums.extend(
|
||||
get_continuations(results, 'gridContinuation', limit - len(albums), request_func,
|
||||
get_continuations(results, 'gridContinuation', remaining_limit, request_func,
|
||||
parse_func))
|
||||
|
||||
return albums
|
||||
|
|
@ -92,9 +93,10 @@ def parse_library_artists(response, request_func, limit):
|
|||
|
||||
if 'continuations' in results:
|
||||
parse_func = lambda contents: parse_artists(contents)
|
||||
remaining_limit = None if limit is None else (limit - len(artists))
|
||||
artists.extend(
|
||||
get_continuations(results, 'musicShelfContinuation', limit - len(artists),
|
||||
request_func, parse_func))
|
||||
get_continuations(results, 'musicShelfContinuation', remaining_limit, request_func,
|
||||
parse_func))
|
||||
|
||||
return artists
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue