Merge pull request 'chuni: fix GetUserNetBattleRankingInfoApi' (#160) from zaphkito/artemis:123/fix-net_battle-aime_id into develop

Reviewed-on: Hay1tsme/artemis#160
This commit is contained in:
Hay1tsme 2024-06-23 21:34:29 +00:00
commit bd78251b6c

View File

@ -793,9 +793,9 @@ class ChuniProfileData(BaseData):
versions = [row[0] for row in versions_raw] versions = [row[0] for row in versions_raw]
return sorted(versions, reverse=True) return sorted(versions, reverse=True)
async def put_net_battle(self, user_id: int, net_battle_data: Dict) -> Optional[int]: async def put_net_battle(self, aime_id: int, net_battle_data: Dict) -> Optional[int]:
sql = insert(net_battle).values( sql = insert(net_battle).values(
user=user_id, user=aime_id,
isRankUpChallengeFailed=net_battle_data['isRankUpChallengeFailed'], isRankUpChallengeFailed=net_battle_data['isRankUpChallengeFailed'],
highestBattleRankId=net_battle_data['highestBattleRankId'], highestBattleRankId=net_battle_data['highestBattleRankId'],
battleIconId=net_battle_data['battleIconId'], battleIconId=net_battle_data['battleIconId'],
@ -816,7 +816,7 @@ class ChuniProfileData(BaseData):
return result.inserted_primary_key['id'] return result.inserted_primary_key['id']
self.logger.error(f"Failed to put net battle data for user {user_id}") self.logger.error(f"Failed to put net battle data for user {user_id}")
async def get_net_battle(self, user_id: int) -> Optional[Row]: async def get_net_battle(self, aime_id: int) -> Optional[Row]:
result = await self.execute(net_battle.select(net_battle.c.user == user_id)) result = await self.execute(net_battle.select(net_battle.c.user == aime_id))
if result: if result:
return result.fetchone() return result.fetchone()