Update watch.py
parent
4b86991945
commit
9583a4979d
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue