[cli/core] Add WebView killswitch to Legendary update data

In case epic breaks it, this at least lets us disable it remotely.
This commit is contained in:
derrod 2021-10-07 05:20:08 +02:00
parent b78b4f49c1
commit b857967dfa
2 changed files with 4 additions and 1 deletions

View file

@ -145,7 +145,7 @@ class LegendaryCLI:
# only import here since pywebview import is slow # only import here since pywebview import is slow
from legendary.utils.webview_login import webview_available, do_webview_login from legendary.utils.webview_login import webview_available, do_webview_login
if not webview_available or args.no_webview: if not webview_available or args.no_webview or self.core.webview_killswitch:
# unfortunately the captcha stuff makes a complete CLI login flow kinda impossible right now... # unfortunately the captcha stuff makes a complete CLI login flow kinda impossible right now...
print('Please login via the epic web login!') print('Please login via the epic web login!')
webbrowser.open( webbrowser.open(

View file

@ -85,6 +85,7 @@ class LegendaryCore:
self.update_available = False self.update_available = False
self.force_show_update = False self.force_show_update = False
self.webview_killswitch = False
def auth(self, username, password): def auth(self, username, password):
""" """
@ -265,6 +266,8 @@ class LegendaryCore:
for app_name in sdl_config.keys(): for app_name in sdl_config.keys():
if app_name not in sdl_games: if app_name not in sdl_games:
sdl_games[app_name] = None sdl_games[app_name] = None
if lgd_config := version_info.get('legendary_config'):
self.webview_killswitch = lgd_config.get('webview_killswitch', False)
def get_update_info(self): def get_update_info(self):
return self.lgd.get_cached_version()['data'].get('release_info') return self.lgd.get_cached_version()['data'].get('release_info')