From 3a6cfedccad79fdc71634cf66d0e5193869d914a Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Thu, 31 Aug 2023 01:24:41 -0400 Subject: [PATCH] maimai: fix net deliver paths --- titles/mai2/config.py | 2 +- titles/mai2/index.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/titles/mai2/config.py b/titles/mai2/config.py index d63c0b2..850e0c1 100644 --- a/titles/mai2/config.py +++ b/titles/mai2/config.py @@ -38,7 +38,7 @@ class Mai2DeliverConfig: @property def content_folder(self) -> int: return CoreConfig.get_config_field( - self.__config, "mai2", "server", "content_folder", default="" + self.__config, "mai2", "deliver", "content_folder", default="" ) class Mai2UploadsConfig: diff --git a/titles/mai2/index.py b/titles/mai2/index.py index be756da..329c1f6 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -228,7 +228,7 @@ class Mai2Servlet: return zlib.compress(json.dumps(resp, ensure_ascii=False).encode("utf-8")) def render_GET(self, request: Request, version: int, url_path: str) -> bytes: - self.logger.info(f"v{version} GET {url_path}") + self.logger.debug(f"v{version} GET {url_path}") url_split = url_path.split("/") if (url_split[0] == "api" and url_split[1] == "movie") or url_split[0] == "movie": @@ -272,9 +272,10 @@ class Mai2Servlet: elif url_split[0] == "deliver": file = url_split[len(url_split) - 1] self.logger.info(f"v{version} {file} deliver inquire") + self.logger.debug(f"{self.game_cfg.deliver.content_folder}/net_deliver/{file}") - if self.game_cfg.deliver.enable and path.exists(f"{self.game_cfg.deliver.content_folder}/{file}"): - with open(f"{self.game_cfg.deliver.content_folder}/deliver/{url_split[-1]}", 'rb') as f: + if self.game_cfg.deliver.enable and path.exists(f"{self.game_cfg.deliver.content_folder}/net_deliver/{file}"): + with open(f"{self.game_cfg.deliver.content_folder}/net_deliver/{file}", 'rb') as f: return f.read() else: