anime-dl / anime-downloader

A simple but powerful anime downloader and streamer.
The Unlicense
1.92k stars 218 forks source link

'watch' unexpected behavior if list is empty #724

Closed imsamuka closed 2 years ago

imsamuka commented 2 years ago

Describe the bug

"Watch" command have unexpected behavior if watch.json list is empty

To reproduce

cd $HOME/.config/anime-downloader
mv watch.json watch.json.bak
echo [] > watch.json
anime watch 

Since it is probably expecting to have at least 1 entry in the list, as the file and list actually exists, it does absolutely nothing after that. It should result in the same thing as when the file doesn't exists:

anime: anime-downloader 5.0.17
Available Commands: swap, new
anime: Add something to watch list first.
LOG ``` 2021-11-30 18:45:31 archbald anime_downloader.util[8117] INFO anime-downloader 5.0.17 2021-11-30 18:45:31 archbald anime_downloader.util[8117] DEBUG Platform: Linux-5.15.3-arch1-1-x86_64-with-glibc2.33 2021-11-30 18:45:31 archbald anime_downloader.util[8117] DEBUG Python 3.9.7 Available Commands: swap, new SlNo | Name | Eps | Score | Status ----------------------------------------------------------------- Select an anime [1]: ```
imsamuka commented 2 years ago

On a tangent, i found this bug after another bug: i failed while trying to use the set option on a anime, the program crashed, and the anime was removed in the process, leaving the list empty, and myself, confused I will see if I open a issue to this as well, i don't think this should be the expected behavior

nate-moo commented 2 years ago

@imsamuka if you don't mind testing #729 for me it would be appreciated