diff --git a/fastanime/cli/__init__.py b/fastanime/cli/__init__.py index b837f33..24a02ad 100644 --- a/fastanime/cli/__init__.py +++ b/fastanime/cli/__init__.py @@ -226,6 +226,17 @@ def run_cli( from .config import Config ctx.obj = Config() + if ctx.obj.check_for_updates: + from .app_updater import check_for_updates + import time + + is_latest = check_for_updates() + if not is_latest: + print( + "You are running an older version of fastanime please update to get the latest features" + ) + time.sleep(10) + ctx.obj.manga = manga if log: import logging diff --git a/fastanime/cli/app_updater.py b/fastanime/cli/app_updater.py index 579dd85..0ef8cf9 100644 --- a/fastanime/cli/app_updater.py +++ b/fastanime/cli/app_updater.py @@ -45,8 +45,9 @@ def check_for_updates(): return (is_latest, release_json) else: + print("Failed to check for updates") print(request.text) - return (False, {}) + return (True, {}) def is_git_repo(author, repository): diff --git a/fastanime/cli/config.py b/fastanime/cli/config.py index b0fa0bc..a970f97 100644 --- a/fastanime/cli/config.py +++ b/fastanime/cli/config.py @@ -33,6 +33,7 @@ class Config(object): "auto_next": "False", "auto_select": "True", "cache_requests": "true", + "check_for_updates": "True", "continue_from_history": "True", "default_media_list_tracking": "None", "downloads_dir": USER_VIDEOS_DIR, @@ -88,6 +89,7 @@ class Config(object): self.auto_next = self.get_auto_next() self.auto_select = self.get_auto_select() self.cache_requests = self.get_cache_requests() + self.check_for_updates = self.configparser.get("general", "check_for_updates") self.continue_from_history = self.get_continue_from_history() self.default_media_list_tracking = self.get_default_media_list_tracking() self.disable_mpv_popen = self.configparser.getboolean( @@ -346,6 +348,11 @@ icons = {self.icons} # this also applies to episode titles normalize_titles = {self.normalize_titles} +# whether to check for updates every time you run the script [True/False] +# this is useful for keeping your script up to date +# cause there are always new features being added 😄 +check_for_updates = {self.check_for_updates} + # can be [allanime, animepahe, hianime] # allanime is the most realible # animepahe provides different links to streams of different quality so a quality can be selected reliably with --quality option