[+] Add playlog info to battle log when upsert

This commit is contained in:
Azalea
2025-01-05 04:23:41 -05:00
parent 4c3ed1d0da
commit 01cb0c4b90
2 changed files with 8 additions and 1 deletions

View File

@@ -71,7 +71,13 @@ fun ChusanController.upsertApiInit() {
// Playlog
userPlaylogList?.let { db.userPlaylog.saveAll(it) }
userNetBattlelogList?.let { db.netBattleLog.saveAll(it.mapApply {
userNetBattlelogList?.let { db.netBattleLog.saveAll(it.mapApplyI { i ->
userPlaylogList?.getOrNull(i)?.let {
musicId = it.musicId
difficultyId = it.level
score = it.score
}
selectUserName = selectUserName.fromChusanUsername()
opponentUserName1 = opponentUserName1.fromChusanUsername()
opponentUserName2 = opponentUserName2.fromChusanUsername()