Skip to content

Commit

Permalink
Merge pull request #45 from liamharper2453/patch-1
Browse files Browse the repository at this point in the history
Better handling of songs that have been removed
  • Loading branch information
zotify-dev authored Feb 7, 2024
2 parents e236b4d + 81edf13 commit 2068eb9
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 2068eb9

Please sign in to comment.