Fix some (unavailable) songs trying to be downloaded

This commit is contained in:
Mike Schwörer 2021-12-15 15:10:56 +01:00
parent 5404ccaf9d
commit 1de70483fe
No known key found for this signature in database
GPG Key ID: D3C7172E0A70F8CF
1 changed files with 7 additions and 5 deletions

View File

@ -48,7 +48,7 @@ def client(args) -> None:
if args.liked_songs:
for song in get_saved_tracks():
if not song[TRACK][NAME]:
if not song[TRACK][NAME] or not song[TRACK][ID]:
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
else:
download_track('liked', song[TRACK][ID])
@ -85,14 +85,16 @@ def download_from_urls(urls: list[str]) -> bool:
enum = 1
char_num = len(str(len(playlist_songs)))
for song in playlist_songs:
if not song[TRACK][NAME]:
if not song[TRACK][NAME] or not song[TRACK][ID]:
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
else:
download_track('playlist', song[TRACK][ID], extra_keys={
'song_name_playlist': song[TRACK][NAME],
download_track('playlist', song[TRACK][ID], extra_keys=
{
'playlist_song_name': song[TRACK][NAME],
'playlist': name,
'playlist_num': str(enum).zfill(char_num),
'playlist_id': playlist_id
'playlist_id': playlist_id,
'playlist_track_id': song[TRACK][ID]
})
enum += 1
elif episode_id is not None: