cm: fix game uris

This commit is contained in:
2023-10-20 02:02:12 -04:00
parent 863f41cbfe
commit d082d124bf

View File

@ -6,6 +6,7 @@ from enum import Enum
import pytz import pytz
from core.config import CoreConfig from core.config import CoreConfig
from core.utils import Utils
from core.data.cache import cached from core.data.cache import cached
from titles.cm.const import CardMakerConstants from titles.cm.const import CardMakerConstants
from titles.cm.config import CardMakerConfig from titles.cm.config import CardMakerConfig
@ -29,7 +30,7 @@ class CardMakerBase:
return version.replace(".", "")[:3] return version.replace(".", "")[:3]
def handle_get_game_connect_api_request(self, data: Dict) -> Dict: def handle_get_game_connect_api_request(self, data: Dict) -> Dict:
if self.core_cfg.server.is_develop: if not self.core_cfg.server.is_using_proxy and Utils.get_title_port() != 80:
uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}" uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}"
else: else:
uri = f"http://{self.core_cfg.title.hostname}" uri = f"http://{self.core_cfg.title.hostname}"
@ -44,19 +45,19 @@ class CardMakerBase:
{ {
"modelKind": 0, "modelKind": 0,
"type": 1, "type": 1,
"titleUri": f"{uri}/SDHD/{self._parse_int_ver(games_ver['chuni'])}/", "titleUri": f"{uri}/{self._parse_int_ver(games_ver['chuni'])}/",
}, },
# maimai DX # maimai DX
{ {
"modelKind": 1, "modelKind": 1,
"type": 1, "type": 1,
"titleUri": f"{uri}/SDEZ/{self._parse_int_ver(games_ver['maimai'])}/", "titleUri": f"{uri}/{self._parse_int_ver(games_ver['maimai'])}/",
}, },
# ONGEKI # ONGEKI
{ {
"modelKind": 2, "modelKind": 2,
"type": 1, "type": 1,
"titleUri": f"{uri}/SDDT/{self._parse_int_ver(games_ver['ongeki'])}/", "titleUri": f"{uri}/{self._parse_int_ver(games_ver['ongeki'])}/",
}, },
], ],
} }