fix poop_songs_random_mix
This commit is contained in:
parent
8f7970b264
commit
bd7a6b452d
2 changed files with 5 additions and 4 deletions
|
|
@ -46,7 +46,7 @@ class UploadsMixin:
|
|||
body["params"] = prepare_order_params(order)
|
||||
response = self._send_request(endpoint, body)
|
||||
results = get_library_contents(response, MUSIC_SHELF)
|
||||
pop_songs_random_mix(results['contents'])
|
||||
pop_songs_random_mix(results)
|
||||
if results is None:
|
||||
return []
|
||||
songs = parse_uploaded_items(results['contents'])
|
||||
|
|
|
|||
|
|
@ -77,13 +77,14 @@ def parse_library_artists(response, request_func, limit):
|
|||
|
||||
def pop_songs_random_mix(results) -> None:
|
||||
"""remove the random mix that conditionally appears at the start of library songs"""
|
||||
if len(results) >= 2:
|
||||
results.pop(0)
|
||||
if results:
|
||||
if len(results['contents']) >= 2:
|
||||
results['contents'].pop(0)
|
||||
|
||||
|
||||
def parse_library_songs(response):
|
||||
results = get_library_contents(response, MUSIC_SHELF)
|
||||
pop_songs_random_mix(results['contents'])
|
||||
pop_songs_random_mix(results)
|
||||
return {
|
||||
'results': results,
|
||||
'parsed': parse_playlist_items(results['contents']) if results else results
|
||||
|
|
|
|||
Loading…
Reference in a new issue