diff options
| author | Mitja Skuver <SilentException@users.noreply.github.com> | 2024-10-13 19:20:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-13 12:20:08 -0700 |
| commit | 8d2b252e6d5fde081255f8bdc02866cc6965b3fc (patch) | |
| tree | 985c8646924300353d609f92e7f3e6e0ff437888 /backend | |
| parent | dbd7488d8f58aaf6ba6a135f1a36d2259e0db8a6 (diff) | |
| download | decky-loader-8d2b252e6d5fde081255f8bdc02866cc6965b3fc.tar.gz decky-loader-8d2b252e6d5fde081255f8bdc02866cc6965b3fc.zip | |
Fixed plugin manual zip installation getting stuck indefinitely (#706)
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/decky_loader/browser.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/backend/decky_loader/browser.py b/backend/decky_loader/browser.py index af23ed0c..f55b269f 100644 --- a/backend/decky_loader/browser.py +++ b/backend/decky_loader/browser.py @@ -213,7 +213,19 @@ class PluginBrowser: return else: - name = sub(r"/.+$", "", plugin_json_list[0]) + plugin_json_file = plugin_json_list[0] + name = sub(r"/.+$", "", plugin_json_file) + try: + with plugin_zip.open(plugin_json_file) as f: + plugin_json_data = json.loads(f.read().decode('utf-8')) + plugin_name_from_plugin_json = plugin_json_data.get('name') + if plugin_name_from_plugin_json and plugin_name_from_plugin_json.strip(): + logger.info(f"Extracted plugin name from {plugin_json_file}: {plugin_name_from_plugin_json}") + name = plugin_name_from_plugin_json + else: + logger.warning(f"Nonexistent or invalid 'name' key value in {plugin_json_file}. Falling back to extracting from path.") + 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) |
