break when no more songs

This commit is contained in:
Mylloon 2023-09-06 03:04:29 +02:00
parent 245c437237
commit b9c2a9f663
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -28,6 +28,10 @@ while True:
else: else:
offset += limit offset += limit
# Break the loop if we reach the end
if len(results['items']) == 0:
break
saved_tracks.extend(results['items']) saved_tracks.extend(results['items'])