From 9583a4979dd7cff8a26b108ca92703619f83e201 Mon Sep 17 00:00:00 2001 From: Arjix <53124886+ArjixWasTaken@users.noreply.github.com> Date: Sat, 12 Feb 2022 06:00:16 -0800 Subject: [PATCH] Update watch.py --- anime_downloader/commands/watch.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/anime_downloader/commands/watch.py b/anime_downloader/commands/watch.py index fe3fea2..2a025da 100644 --- a/anime_downloader/commands/watch.py +++ b/anime_downloader/commands/watch.py @@ -68,16 +68,9 @@ def command(anime_name, new, update_all, _list, quality, remove, watcher = _watch.Watcher() if not os.path.exists(watcher.WATCH_FILE): - with open(watcer.WATCH_FILE, "w") as f: + with open(watcher.WATCH_FILE, "w") as f: f.write("[]") - 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 @@ -89,6 +82,13 @@ def command(anime_name, new, update_all, _list, quality, remove, watcher.new(url) sys.exit(0) + with open(watcher.WATCH_FILE, "r") as f: + contents = f.read() + # print(contents) + if "[]" in contents: + logger.error("Add something to the watch list using `anime watch --new`") + sys.exit(1) + if remove: anime = watcher.get(anime_name) if anime and click.confirm(