ignore playlist items with track: null
This commit is contained in:
parent
c13181beae
commit
267fd32898
|
|
@ -75,7 +75,10 @@ class Client:
|
||||||
elif spotify_type == "album":
|
elif spotify_type == "album":
|
||||||
return Album(data)
|
return Album(data)
|
||||||
else:
|
else:
|
||||||
tracks = [Track(track["track"]) for track in data["tracks"]["items"]]
|
tracks = [
|
||||||
|
Track(track["track"])
|
||||||
|
for track in data["tracks"]["items"] if track["track"] is not None
|
||||||
|
]
|
||||||
next_page_url = data["tracks"]["next"]
|
next_page_url = data["tracks"]["next"]
|
||||||
|
|
||||||
while next_page_url is not None:
|
while next_page_url is not None:
|
||||||
|
|
@ -87,7 +90,10 @@ class Client:
|
||||||
|
|
||||||
next_data: dict = await resp.json()
|
next_data: dict = await resp.json()
|
||||||
|
|
||||||
tracks += [Track(track["track"]) for track in next_data["items"]]
|
tracks += [
|
||||||
|
Track(track["track"])
|
||||||
|
for track in next_data["items"] if track["track"] is not None
|
||||||
|
]
|
||||||
next_page_url = next_data["next"]
|
next_page_url = next_data["next"]
|
||||||
|
|
||||||
return Playlist(data, tracks)
|
return Playlist(data, tracks)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue