idac: hotfix round creation

This commit is contained in:
Dniel97 2024-06-13 00:17:38 +02:00
parent 8b9e1f94e6
commit c35e14b640
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08

View File

@ -120,24 +120,24 @@ class IDACOnlineRounds(BaseData):
self, round_id: int, version: int, round_data: Dict self, round_id: int, version: int, round_data: Dict
) -> Optional[int]: ) -> Optional[int]:
sql = select(round_details).where( sql = select(round_details).where(round_details.c.round_id_in_json == round_id)
round_details.c.round_id_in_json == round_id
)
result = await self.execute(sql) result = await self.execute(sql)
rid = result.fetchone()
if rid is None: if result is None:
tmp = {} tmp = {
tmp["round_id_in_json"] = round_id "round_id_in_json": round_id,
tmp["name"] = round_data["round_event_nm"] "name": round_data["round_event_nm"],
tmp["season"] = version "season": version,
tmp["start_dt"] = datetime.datetime.fromtimestamp(round_data["start_dt"]) "start_dt": datetime.fromtimestamp(round_data["start_dt"]),
tmp["end_dt"] = datetime.datetime.fromtimestamp(round_data["end_dt"]) "end_dt": datetime.fromtimestamp(round_data["end_dt"]),
}
sql = insert(round_details).values(**tmp) sql = insert(round_details).values(**tmp)
result = await self.execute(sql) result = await self.execute(sql)
return result.lastrowid return result.lastrowid
rid = result.fetchone()
return rid["id"] return rid["id"]
# TODO: get top five players of last round event for Boot/GetConfigData # TODO: get top five players of last round event for Boot/GetConfigData