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(