Skip to content

Commit

Permalink
Better handling of songs that have been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
liamharper2453 authored Nov 12, 2023
1 parent e236b4d commit 81edf13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zotify/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def client(args) -> None:

if args.liked_songs:
for song in get_saved_tracks():
if not song[TRACK][NAME] or not song[TRACK][ID]:
if not song.get(TRACK) or not song[TRACK].get(NAME) or not song[TRACK].get(ID):
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ANYMORE ###' + "\n")
else:
download_track('liked', song[TRACK][ID])
Expand Down Expand Up @@ -105,7 +105,7 @@ 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] or not song[TRACK][ID]:
if not song.get(TRACK) or not song[TRACK].get(NAME) or not song[TRACK].get(ID):
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ANYMORE ###' + "\n")
else:
if song[TRACK][TYPE] == "episode": # Playlist item is a podcast episode
Expand Down

0 comments on commit 81edf13

Please sign in to comment.