More file movement

This commit is contained in:
zkldi
2021-04-30 02:10:08 +01:00
parent 1c06c85b18
commit abf38477fc
3 changed files with 5 additions and 2 deletions
@@ -1,4 +1,5 @@
import { config, Game, Grades, IDStrings } from "kamaitachi-common";
import { logger } from "../../../logger";
/**
* Util for getting a games' grade for a given percent.
@@ -18,5 +19,6 @@ export function GetGradeFromPercent<I extends IDStrings = IDStrings>(
}
}
// failsafe
return null;
}
@@ -31,7 +31,7 @@ export default async function HydrateScore(
{
// @todo lamps may need to be separate upon game:playtype someday. Maybe. We need to check this out
lampIndex: config.lamps[dryScore.game].indexOf(dryScore.scoreData.lamp as string),
gradeIndex: config.grades[dryScore.game].indexOf(dryScore.scoreData.lamp as string),
gradeIndex: config.grades[dryScore.game].indexOf(dryScore.scoreData.grade as string),
},
dryScoreData
);
@@ -9,7 +9,7 @@ import {
InvalidScoreFailure,
} from "../../../framework/importing/converter-failures";
import ScoreImportFatalError from "../../../framework/importing/score-import-error";
import { GetGradeFromPercent } from "../../../framework/importing/score-utils";
import { GetGradeFromPercent } from "../../../framework/common/score-utils";
import { AssertStrAsPositiveInt } from "../../../framework/common/string-asserts";
import { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types";
@@ -107,6 +107,7 @@ export async function EamScoreConverter(
const grade = GetGradeFromPercent<"iidx:SP" | "iidx:DP">("iidx", percent);
if (!grade) {
logger.warn(`${HUMANISED_CHART_TITLE} - Could not resolve ${percent} into a grade?`);
throw new InternalFailure(
`${HUMANISED_CHART_TITLE} - Could not resolve ${percent} into a grade?`
);