forked from Dniel97/artemis
ongeki: fix handle_upsert_client_setting_api_request
This commit is contained in:
parent
936316f129
commit
262155f83f
@ -268,7 +268,9 @@ class OngekiBase:
|
||||
|
||||
client_id = data["clientId"]
|
||||
client_setting_data = data["clientSetting"]
|
||||
self.data.static.put_client_setting_data(client_id, client_setting_data)
|
||||
cab = self.data.arcade.get_machine(client_id)
|
||||
if cab is not None:
|
||||
self.data.static.put_client_setting_data(cab['id'], client_setting_data)
|
||||
return {"returnCode": 1, "apiName": "UpsertClientSettingApi"}
|
||||
|
||||
def handle_upsert_client_testmode_api_request(self, data: Dict) -> Dict:
|
||||
|
@ -486,13 +486,12 @@ class OngekiStaticData(BaseData):
|
||||
return None
|
||||
return result.lastrowid
|
||||
|
||||
def put_client_setting_data(self, client_id: str, client_setting_data: Dict) -> Optional[List[Dict]]:
|
||||
sql = insert(machine).values(data=client_setting_data)
|
||||
conflict = sql.on_duplicate_key_update(serial=client_id)
|
||||
def put_client_setting_data(self, machine_id: int, client_setting_data: Dict) -> Optional[List[Dict]]:
|
||||
sql = machine.update(machine.c.id == machine_id).values(data=client_setting_data)
|
||||
|
||||
result = self.execute(conflict)
|
||||
result = self.execute(sql)
|
||||
if result is None:
|
||||
self.logger.warning(f"clientId: {client_id} Failed to update ClientSetting data"),
|
||||
self.logger.warning(f"machine_id: {machine_id} Failed to update ClientSetting data"),
|
||||
return None
|
||||
return result.lastrowid
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user