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)
|
body["params"] = prepare_order_params(order)
|
||||||
response = self._send_request(endpoint, body)
|
response = self._send_request(endpoint, body)
|
||||||
results = get_library_contents(response, MUSIC_SHELF)
|
results = get_library_contents(response, MUSIC_SHELF)
|
||||||
pop_songs_random_mix(results['contents'])
|
pop_songs_random_mix(results)
|
||||||
if results is None:
|
if results is None:
|
||||||
return []
|
return []
|
||||||
songs = parse_uploaded_items(results['contents'])
|
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:
|
def pop_songs_random_mix(results) -> None:
|
||||||
"""remove the random mix that conditionally appears at the start of library songs"""
|
"""remove the random mix that conditionally appears at the start of library songs"""
|
||||||
if len(results) >= 2:
|
if results:
|
||||||
results.pop(0)
|
if len(results['contents']) >= 2:
|
||||||
|
results['contents'].pop(0)
|
||||||
|
|
||||||
|
|
||||||
def parse_library_songs(response):
|
def parse_library_songs(response):
|
||||||
results = get_library_contents(response, MUSIC_SHELF)
|
results = get_library_contents(response, MUSIC_SHELF)
|
||||||
pop_songs_random_mix(results['contents'])
|
pop_songs_random_mix(results)
|
||||||
return {
|
return {
|
||||||
'results': results,
|
'results': results,
|
||||||
'parsed': parse_playlist_items(results['contents']) if results else results
|
'parsed': parse_playlist_items(results['contents']) if results else results
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue