mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 03:52:02 +00:00
fix static/lang file fetch and method call
This commit is contained in:
@@ -102,13 +102,12 @@ class Loader:
|
|||||||
self.watcher.disabled = False
|
self.watcher.disabled = False
|
||||||
|
|
||||||
async def handle_frontend_assets(self, request: web.Request):
|
async def handle_frontend_assets(self, request: web.Request):
|
||||||
file = path.join(path.dirname(__file__), "..", "static", request.match_info["path"])
|
file = Path(__file__).parents[1].joinpath("static").joinpath(request.match_info["path"])
|
||||||
|
|
||||||
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
|
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
|
||||||
|
|
||||||
async def handle_frontend_locales(self, request: web.Request):
|
async def handle_frontend_locales(self, request: web.Request):
|
||||||
req_lang = request.match_info["path"]
|
req_lang = request.match_info["path"]
|
||||||
file = path.join(path.dirname(__file__), "..", "locales", req_lang)
|
file = Path(__file__).parents[1].joinpath("locales").joinpath(req_lang)
|
||||||
if exists(file):
|
if exists(file):
|
||||||
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
|
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
|
||||||
else:
|
else:
|
||||||
@@ -143,7 +142,7 @@ class Loader:
|
|||||||
self.plugins.pop(plugin.name, None)
|
self.plugins.pop(plugin.name, None)
|
||||||
if plugin.passive:
|
if plugin.passive:
|
||||||
self.logger.info(f"Plugin {plugin.name} is passive")
|
self.logger.info(f"Plugin {plugin.name} is passive")
|
||||||
self.plugins[plugin.name] = plugin
|
self.plugins[plugin.name] = plugin.start()
|
||||||
self.logger.info(f"Loaded {plugin.name}")
|
self.logger.info(f"Loaded {plugin.name}")
|
||||||
if not batch:
|
if not batch:
|
||||||
self.loop.create_task(self.dispatch_plugin(plugin.name, plugin.version))
|
self.loop.create_task(self.dispatch_plugin(plugin.name, plugin.version))
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ class MethodCallRequest:
|
|||||||
await self.event.wait()
|
await self.event.wait()
|
||||||
if not self.response.success:
|
if not self.response.success:
|
||||||
raise Exception(self.response.result)
|
raise Exception(self.response.result)
|
||||||
return self.response
|
return self.response.result
|
||||||
Reference in New Issue
Block a user