IIDX: misc

This commit is contained in:
duel0213 2024-11-26 20:59:52 +09:00
parent f231932289
commit 09407661ef

View File

@ -365,13 +365,7 @@ export const importScoreData = async (data, send: WebUISend) => {
case 2:
let sd_ver2: score[] = content.data;
for (let a = 0; a < count; a++) {
await DB.Upsert<score>(data.refid,
{
collection: "score",
mid: sd_ver2[a].mid
},
{
$set: {
let result = {
pgArray: sd_ver2[a].pgArray,
gArray: sd_ver2[a].gArray,
mArray: sd_ver2[a].mArray,
@ -381,6 +375,25 @@ export const importScoreData = async (data, send: WebUISend) => {
optArray: sd_ver2[a].optArray,
opt2Array: sd_ver2[a].opt2Array,
};
for (let b = 0; b < 10; b++) {
if (_.isNil(sd_ver2[a][b])) continue;
result[b] = sd_ver2[a][b];
if (!_.isNil(sd_ver2[a][b + 10])) {
result[b + 10] = sd_ver2[a][b + 10];
}
}
await DB.Upsert<score>(data.refid,
{
collection: "score",
mid: sd_ver2[a].mid
},
{
$set: {
...result,
}
}
);