summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-10-13 20:22:02 +0100
committerGitHub <noreply@github.com>2024-10-13 12:22:02 -0700
commit4c95484ccb7e7ac5f2e3d62fa8f1a8707d7f2608 (patch)
treeff9dc0d79102b6021eeb00746f05fd91928b339b
parent8d2b252e6d5fde081255f8bdc02866cc6965b3fc (diff)
downloaddecky-loader-4c95484ccb7e7ac5f2e3d62fa8f1a8707d7f2608.tar.gz
decky-loader-4c95484ccb7e7ac5f2e3d62fa8f1a8707d7f2608.zip
move check for if plugin was installed to the start of the function (#715)v3.0.3-pre1
-rw-r--r--backend/decky_loader/browser.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/backend/decky_loader/browser.py b/backend/decky_loader/browser.py
index f55b269f..aa108c59 100644
--- a/backend/decky_loader/browser.py
+++ b/backend/decky_loader/browser.py
@@ -157,8 +157,16 @@ class PluginBrowser:
# Will be set later in code
res_zip = None
- # Check if plugin is installed
+ # Check if plugin was already installed before this
isInstalled = False
+
+ try:
+ pluginFolderPath = self.find_plugin_folder(name)
+ if pluginFolderPath:
+ isInstalled = True
+ except:
+ logger.error(f"Failed to determine if {name} is already installed, continuing anyway.")
+
# Preserve plugin order before removing plugin (uninstall alters the order and removes the plugin from the list)
current_plugin_order = self.settings.getSetting("pluginOrder")[:]
if self.loader.watcher:
@@ -227,13 +235,6 @@ class PluginBrowser:
except Exception as e:
logger.error(f"Failed to read or parse {plugin_json_file}: {str(e)}. Falling back to extracting from path.")
- try:
- pluginFolderPath = self.find_plugin_folder(name)
- if pluginFolderPath:
- isInstalled = True
- except:
- logger.error(f"Failed to determine if {name} is already installed, continuing anyway.")
-
# Check to make sure we got the file
if res_zip is None:
logger.fatal(f"Could not fetch {artifact}")