Skip to content

Commit

Permalink
Fix bug in anime watch with empty watch list not exiting automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-moo committed Jan 15, 2022
1 parent 17fb8fe commit d1c5952
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions anime_downloader/commands/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def command(anime_name, new, update_all, _list, quality, remove,
util.print_info(__version__)
watcher = _watch.Watcher()

with open(watcher.WATCH_FILE, "r") as f:
contents = f.read()
# print(contents)
if "[]" in contents or "[{}]" in contents:
logger.error("Add something to the watch list using `anime watch --new`")
sys.exit(1)

if new:
if anime_name:
query = anime_name
Expand Down

1 comment on commit d1c5952

@gjennks
Copy link

@gjennks gjennks commented on d1c5952 Jan 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing issues with fresh installed where watch.json does not exist.
If they try run anime watch "anime" command without adding anything first.

Line 173 of watch.py of the main dir might be more what you need.
if not os.path.exists(self.WATCH_FILE):

Please sign in to comment.