summaryrefslogtreecommitdiff
path: root/backend/decky_loader/loader.py
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2025-07-01 14:49:48 -0400
committerGitHub <noreply@github.com>2025-07-01 14:49:48 -0400
commit7b8a18d02d8e6b098f3399d015cf22dd04bc561c (patch)
tree7139a04320c70caaaea7a53b77e7b4ff1132ab1a /backend/decky_loader/loader.py
parentf327c6c792cb6beb1f32f70045e577a542a48070 (diff)
parentcbea1518ed1e88fde34e40a16a0e9c20e954a9f5 (diff)
downloaddecky-loader-7b8a18d02d8e6b098f3399d015cf22dd04bc561c.tar.gz
decky-loader-7b8a18d02d8e6b098f3399d015cf22dd04bc561c.zip
Merge branch 'main' into aa/fix-updater-reload
Diffstat (limited to 'backend/decky_loader/loader.py')
-rw-r--r--backend/decky_loader/loader.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/backend/decky_loader/loader.py b/backend/decky_loader/loader.py
index 6a324e23..e2e619f7 100644
--- a/backend/decky_loader/loader.py
+++ b/backend/decky_loader/loader.py
@@ -8,6 +8,7 @@ from typing import Any, Tuple, Dict, cast
from aiohttp import web
from os.path import exists
+from decky_loader.helpers import get_homebrew_path
from watchdog.events import RegexMatchingEventHandler, FileSystemEvent
from watchdog.observers import Observer
@@ -91,6 +92,7 @@ class Loader:
web.get("/plugins/{plugin_name}/frontend_bundle", self.handle_frontend_bundle),
web.get("/plugins/{plugin_name}/dist/{path:.*}", self.handle_plugin_dist),
web.get("/plugins/{plugin_name}/assets/{path:.*}", self.handle_plugin_frontend_assets),
+ web.get("/plugins/{plugin_name}/data/{path:.*}", self.handle_plugin_frontend_assets_from_data),
])
server_instance.ws.add_route("loader/get_plugins", self.get_plugins)
@@ -142,6 +144,13 @@ class Loader:
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
+ async def handle_plugin_frontend_assets_from_data(self, request: web.Request):
+ plugin = self.plugins[request.match_info["plugin_name"]]
+ home = get_homebrew_path()
+ file = path.join(home, "data", plugin.plugin_directory, request.match_info["path"])
+
+ return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
+
async def handle_frontend_bundle(self, request: web.Request):
plugin = self.plugins[request.match_info["plugin_name"]]
@@ -216,4 +225,4 @@ class Loader:
async def handle_plugin_backend_reload(self, plugin_name: str):
plugin = self.plugins[plugin_name]
- await self.reload_queue.put((plugin.file, plugin.plugin_directory)) \ No newline at end of file
+ await self.reload_queue.put((plugin.file, plugin.plugin_directory))