treewide: fix package structure

The static files need to be inside the module to be installed correctly
as part of the module.
This commit is contained in:
K900
2024-06-27 11:46:47 +03:00
committed by AAGaming
parent 6cd4fb5553
commit 5697d98862
30 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -106,12 +106,12 @@ class Loader:
self.watcher.disabled = False
async def handle_frontend_assets(self, request: web.Request):
file = Path(__file__).parents[1].joinpath("static").joinpath(request.match_info["path"])
file = Path(__file__).parent.joinpath("static").joinpath(request.match_info["path"])
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
async def handle_frontend_locales(self, request: web.Request):
req_lang = request.match_info["path"]
file = Path(__file__).parents[1].joinpath("locales").joinpath(req_lang)
file = Path(__file__).parent.joinpath("locales").joinpath(req_lang)
if exists(file):
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
else: