summaryrefslogtreecommitdiff
path: root/backend/decky_loader/loader.py
diff options
context:
space:
mode:
authorjbofill <74568881+jessebofill@users.noreply.github.com>2025-12-30 12:29:08 -0700
committerGitHub <noreply@github.com>2025-12-30 13:29:08 -0600
commit9f586a1b97cf9069fbfbeee17e3909baf9e95f66 (patch)
treec3477abcd8edec5fdf61251748a4f3bbef165e83 /backend/decky_loader/loader.py
parent789851579b8eaff70c2fb9da999e86d86a2d95bd (diff)
downloaddecky-loader-9f586a1b97cf9069fbfbeee17e3909baf9e95f66.tar.gz
decky-loader-9f586a1b97cf9069fbfbeee17e3909baf9e95f66.zip
Feat: Disable plugins (#850)HEADmain
* implement base frontend changes necessary for plugin disabling * implement frontend diisable functions/ modal * plugin disable boilerplate / untested * Feat disable plugins (#810) * implement base frontend changes necessary for plugin disabling * implement frontend diisable functions/ modal --------- Co-authored-by: Jesse Bofill <jesse_bofill@yahoo.com> * fix mistakes * add frontend * working plugin disable, not tested extensively * fix uninstalled hidden plugins remaining in list * hide plugin irrelevant plugin setting menu option when disabled * fix hidden plugin issues * reset disabled plugin on uninstall * fix plugin load on reenable * move disable settings uninstall cleanup * add engilsh tranlsations for enable/ disable elements * fix bug where wrong loadType can get passed to importPlugin * show correct number of hidden plugins if plugin is both hidden and disabled * fix: get fresh list of plugin updates when changed in settings plugin list * fix: fix invalid semver plugin version from preventing latest updates * retain x position when changing focus in list items that have multiple horizontal focusables * correction to pluging version checking validation * make sure disabled plugins get checked for updates * show number of disabled plugins at bottom of plugin view * add notice to update modals that disabled plugins will be enabled upon installation * run formatter * Update backend/decky_loader/locales/en-US.json Co-authored-by: EMERALD <hudson.samuels@gmail.com> * chore: correct filename typo * chore: change disabled icon * chore: revert accidental defsettings changes * format * add timeout to frontend importPlugin if a request hangs this prevent it from blocking other plugin loads. backend diaptch_plugin which calls this for individual plugin load (as opposed to batch) is set to 15s. other callers of importPlugin are not using timeout, same as before. * fix plugin update checking loop --------- Co-authored-by: marios <marios8543@gmail.com> Co-authored-by: EMERALD <hudson.samuels@gmail.com>
Diffstat (limited to 'backend/decky_loader/loader.py')
-rw-r--r--backend/decky_loader/loader.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/backend/decky_loader/loader.py b/backend/decky_loader/loader.py
index e2e619f7..4574cd1d 100644
--- a/backend/decky_loader/loader.py
+++ b/backend/decky_loader/loader.py
@@ -78,6 +78,7 @@ class Loader:
self.live_reload = live_reload
self.reload_queue: ReloadQueue = Queue()
self.loop.create_task(self.handle_reloads())
+ self.context: PluginManager = server_instance
if live_reload:
self.observer = Observer()
@@ -130,7 +131,7 @@ class Loader:
async def get_plugins(self):
plugins = list(self.plugins.values())
- return [{"name": str(i), "version": i.version, "load_type": i.load_type} for i in plugins]
+ return [{"name": str(i), "version": i.version, "load_type": i.load_type, "disabled": i.disabled} for i in plugins]
async def handle_plugin_dist(self, request: web.Request):
plugin = self.plugins[request.match_info["plugin_name"]]
@@ -164,6 +165,10 @@ class Loader:
await self.ws.emit(f"loader/plugin_event", {"plugin": plugin.name, "event": event, "args": args})
plugin = PluginWrapper(file, plugin_directory, self.plugin_path, plugin_emitted_event)
+ if hasattr(self.context, "utilities") and plugin.name in await self.context.utilities.get_setting("disabled_plugins",[]):
+ plugin.disabled = True
+ self.plugins[plugin.name] = plugin
+ return
if plugin.name in self.plugins:
if not "debug" in plugin.flags and refresh:
self.logger.info(f"Plugin {plugin.name} is already loaded and has requested to not be re-loaded")
@@ -183,7 +188,7 @@ class Loader:
print_exc()
async def dispatch_plugin(self, name: str, version: str | None, load_type: int = PluginLoadType.ESMODULE_V1.value):
- await self.ws.emit("loader/import_plugin", name, version, load_type)
+ await self.ws.emit("loader/import_plugin", name, version, load_type, True, 15000)
async def import_plugins(self):
self.logger.info(f"import plugins from {self.plugin_path}")