more tidy

This commit is contained in:
zkldi
2021-04-29 16:26:59 +01:00
parent 4fd9e471c8
commit a8a6a249e6
3 changed files with 7 additions and 13 deletions
@@ -2,9 +2,9 @@ import {
integer,
ImportTypes,
ScoreDocument,
ScoreCore,
SessionDocument,
Playtypes,
PBScoreDocument,
SessionScoreInfo,
SessionInfoReturn,
Game,
@@ -51,7 +51,7 @@ export async function CreateSessions(
function ProcessScoreIntoSessionScoreInfo(
score: ScoreDocument,
previousPB: ScoreDocument | undefined
previousPB: PBScoreDocument | undefined
): SessionScoreInfo {
if (!previousPB) {
return {
@@ -195,16 +195,13 @@ export async function LoadScoresIntoSessions(
let startOfGroup = groupScores[0].timeAchieved!;
let endOfGroup = groupScores[groupScores.length - 1].timeAchieved!;
let pbs = await db.scores.find({
let pbs = await db["score-pbs"].find({
chartID: { $in: groupScores.map((e) => e.chartID) },
userID,
isScorePB: true,
});
let coercedPBs = await ScoreCore.AutoCoerce(db.scores, pbs);
let pbMap: Map<string, ScoreDocument> = new Map();
for (const pb of coercedPBs) {
let pbMap: Map<string, PBScoreDocument> = new Map();
for (const pb of pbs) {
pbMap.set(pb.chartID, pb);
}
@@ -0,0 +1 @@
[]
+1 -5
View File
@@ -23,9 +23,7 @@
"calculatedData": {
"rating": 0.1,
"lampRating": 5,
"gameSpecific": {},
"ranking": null,
"outOf": null
"gameSpecific": {}
},
"timeAchieved": null,
"songID": 1,
@@ -33,8 +31,6 @@
"highlight": false,
"comment": null,
"timeAdded": 1,
"isScorePB": true,
"isLampPB": true,
"scoreID": "TESTING_SCORE_ID",
"importType": "iidx:eamusement-csv"
}