Skip to content

Commit

Permalink
Fixed plugin manual zip installation getting stuck indefinitely
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentException committed Sep 22, 2024
1 parent 2f90a4f commit 819bd48
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion backend/decky_loader/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,19 @@ async def _install(self, artifact: str, name: str, version: str, hash: str):
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)
Expand Down

0 comments on commit 819bd48

Please sign in to comment.