forked from Hay1tsme/artemis
add upserts
This commit is contained in:
parent
5378655c52
commit
a1d54efbac
@ -941,6 +941,31 @@ class ChuniBase:
|
|||||||
rating_type,
|
rating_type,
|
||||||
upsert[rating_type],
|
upsert[rating_type],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# added in LUMINOUS
|
||||||
|
if "userCMissionList" in upsert:
|
||||||
|
for cmission in upsert["userCMissionList"]:
|
||||||
|
mission_id = cmission["missionId"]
|
||||||
|
|
||||||
|
await self.data.item.put_cmission(
|
||||||
|
user_id,
|
||||||
|
{
|
||||||
|
"missionId": mission_id,
|
||||||
|
"point": cmission["point"],
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
for progress in cmission["userCMissionProgressList"]:
|
||||||
|
await self.data.item.put_cmission_progress(user_id, mission_id, progress)
|
||||||
|
|
||||||
|
if "userNetBattleData" in upsert:
|
||||||
|
net_battle = upsert["userNetBattleData"][0]
|
||||||
|
|
||||||
|
# fix the boolean
|
||||||
|
net_battle["isRankUpChallengeFailed"] = (
|
||||||
|
False if net_battle["isRankUpChallengeFailed"] == "false" else True
|
||||||
|
)
|
||||||
|
await self.data.profile.put_net_battle(user_id, net_battle)
|
||||||
|
|
||||||
return {"returnCode": "1"}
|
return {"returnCode": "1"}
|
||||||
|
|
||||||
@ -969,4 +994,4 @@ class ChuniBase:
|
|||||||
return {
|
return {
|
||||||
"userId": data["userId"],
|
"userId": data["userId"],
|
||||||
"userNetBattleData": {"recentNBSelectMusicList": []},
|
"userNetBattleData": {"recentNBSelectMusicList": []},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user