From bace5143d28c42ffcc83509b7fcdf02b6cae6934 Mon Sep 17 00:00:00 2001 From: TrainDoctor Date: Sun, 30 Oct 2022 10:32:05 -0700 Subject: Merge Tabs and Injection Fixes, bring back native Valve toaster (#238) * Bring back component patch-based tabshook * better injection point * finally fix dumb loading error * fix QAM injection breaking after lock * shut up typescript * fix lock screen focusing issues * Bring back the Valve toaster! * Add support for stable steamos * fix focus bug on lock screen but actually * oops: remove extra console log * shut up typescript again * better fix for lockscreen bug * better probably * actually fix focus issues (WTF) Co-authored-by: AAGaming --- backend/loader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'backend/loader.py') diff --git a/backend/loader.py b/backend/loader.py index 8c48c7ae..e756ba5e 100644 --- a/backend/loader.py +++ b/backend/loader.py @@ -121,7 +121,7 @@ class Loader: with open(path.join(self.plugin_path, plugin.plugin_directory, "dist/index.js"), 'r') as bundle: return web.Response(text=bundle.read(), content_type="application/javascript") - def import_plugin(self, file, plugin_directory, refresh=False): + def import_plugin(self, file, plugin_directory, refresh=False, batch=False): try: plugin = PluginWrapper(file, plugin_directory, self.plugin_path) if plugin.name in self.plugins: @@ -135,7 +135,8 @@ class Loader: self.logger.info(f"Plugin {plugin.name} is passive") self.plugins[plugin.name] = plugin.start() self.logger.info(f"Loaded {plugin.name}") - self.loop.create_task(self.dispatch_plugin(plugin.name if not plugin.legacy else "$LEGACY_" + plugin.name, plugin.version)) + if not batch: + self.loop.create_task(self.dispatch_plugin(plugin.name if not plugin.legacy else "$LEGACY_" + plugin.name, plugin.version)) except Exception as e: self.logger.error(f"Could not load {file}. {e}") print_exc() @@ -150,7 +151,7 @@ class Loader: directories = [i for i in listdir(self.plugin_path) if path.isdir(path.join(self.plugin_path, i)) and path.isfile(path.join(self.plugin_path, i, "plugin.json"))] for directory in directories: self.logger.info(f"found plugin: {directory}") - self.import_plugin(path.join(self.plugin_path, directory, "main.py"), directory) + self.import_plugin(path.join(self.plugin_path, directory, "main.py"), directory, False, True) async def handle_reloads(self): while True: -- cgit v1.2.3