mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 10:58:07 +03:00
checkpoint: insanity ascends (35)
127 errors to go
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { CreatePBMergeFor } from "game-implementations/utils/pb-merge";
|
||||
import { ProfileSumBestN } from "game-implementations/utils/profile-calc";
|
||||
import { SessionAvgBest10For } from "game-implementations/utils/session-calc";
|
||||
import { InternalFailure } from "lib/score-import/framework/common/converter-failures";
|
||||
import { Volforce } from "rg-stats";
|
||||
import {
|
||||
FmtNum,
|
||||
FmtNumCompact,
|
||||
GetGrade,
|
||||
GetGradeDeltas,
|
||||
IIDXLIKE_GBOUNDARIES,
|
||||
SDVXLIKE_GBOUNDARIES,
|
||||
@@ -26,22 +26,6 @@ import type {
|
||||
} from "game-implementations/types";
|
||||
import type { GPTStrings, GradeBoundary, integer, SpecificUserGameStats } from "tachi-common";
|
||||
|
||||
/**
|
||||
* Util for getting a games' grade for a given score.
|
||||
*/
|
||||
export function GetGrade<G extends string>(grades: Array<GradeBoundary<G>>, score: number): G {
|
||||
// sort grades going downwards in their boundaries.
|
||||
const descendingGrades = grades.slice(0).sort((a, b) => b.lowerBound - a.lowerBound);
|
||||
|
||||
for (const { name, lowerBound } of descendingGrades) {
|
||||
if (score >= lowerBound) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InternalFailure(`Could not resolve grade for score ${score}.`);
|
||||
}
|
||||
|
||||
export const EX_SCORE_CHECK: ChartSpecificMetricValidator<IIDXLikes> = (exScore, chart) => {
|
||||
if (exScore < 0) {
|
||||
return `EX Score cannot be negative. Got ${exScore}.`;
|
||||
|
||||
@@ -41,7 +41,7 @@ export async function CreateGameSettings(userID: integer, game: Game, playtype:
|
||||
preferredProfileAlg: null,
|
||||
preferredSessionAlg: null,
|
||||
preferredScoreAlg: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
preferredRanking: null,
|
||||
stats: [],
|
||||
|
||||
@@ -24,7 +24,7 @@ t.test("#EvalulateUsersStatsShowcase", (t) => {
|
||||
preferredProfileAlg: null,
|
||||
preferredScoreAlg: null,
|
||||
preferredSessionAlg: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
preferredRanking: null,
|
||||
stats: [
|
||||
|
||||
+5
-5
@@ -21,7 +21,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/settings", (t) => {
|
||||
preferredSessionAlg: null,
|
||||
preferredProfileAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
stats: [],
|
||||
gameSpecific: {
|
||||
@@ -69,7 +69,7 @@ t.test("PATCH /api/v1/users/:userID/games/:game/:playtype/settings", (t) => {
|
||||
preferredScoreAlg: "ktLampRating",
|
||||
preferredSessionAlg: null,
|
||||
preferredProfileAlg: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
preferredRanking: null,
|
||||
defaultTable: null,
|
||||
stats: [],
|
||||
@@ -127,7 +127,7 @@ t.test("PATCH /api/v1/users/:userID/games/:game/:playtype/settings", (t) => {
|
||||
preferredSessionAlg: null,
|
||||
preferredProfileAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
stats: [],
|
||||
gameSpecific: {
|
||||
@@ -188,7 +188,7 @@ t.test("PATCH /api/v1/users/:userID/games/:game/:playtype/settings", (t) => {
|
||||
preferredSessionAlg: null,
|
||||
preferredProfileAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
stats: [],
|
||||
gameSpecific: {
|
||||
@@ -380,7 +380,7 @@ t.test("PATCH /api/v1/users/:userID/games/:game/:playtype/settings", (t) => {
|
||||
preferredSessionAlg: null,
|
||||
preferredProfileAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: "mock_table",
|
||||
stats: [],
|
||||
gameSpecific: {
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ router.patch(
|
||||
preferredRanking: optNull(p.isIn("global", "rival")),
|
||||
|
||||
gameSpecific: optNull(gameSpecificSchema),
|
||||
scoreBucket: optNull(p.isIn("grade", "lamp")),
|
||||
preferredDefaultEnum: optNull(p.isIn("grade", "lamp")),
|
||||
});
|
||||
|
||||
if (err) {
|
||||
@@ -86,8 +86,8 @@ router.patch(
|
||||
}
|
||||
}
|
||||
|
||||
if (body.scoreBucket !== undefined) {
|
||||
updateQuery[`preferences.scoreBucket`] = body.scoreBucket;
|
||||
if (body.preferredDefaultEnum !== undefined) {
|
||||
updateQuery[`preferences.preferredDefaultEnum`] = body.preferredDefaultEnum;
|
||||
}
|
||||
|
||||
if (body.defaultTable !== undefined) {
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ const SetFolders = async () => {
|
||||
preferredScoreAlg: null,
|
||||
preferredSessionAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
stats: [
|
||||
{
|
||||
@@ -90,7 +90,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/showcase", (t) => {
|
||||
preferredScoreAlg: null,
|
||||
preferredSessionAlg: null,
|
||||
preferredRanking: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
defaultTable: null,
|
||||
stats: [
|
||||
{
|
||||
|
||||
@@ -839,7 +839,7 @@ export const FakeGameSettings: UGPTSettingsDocument = {
|
||||
preferredProfileAlg: null,
|
||||
preferredScoreAlg: null,
|
||||
preferredSessionAlg: null,
|
||||
scoreBucket: null,
|
||||
preferredDefaultEnum: null,
|
||||
preferredRanking: null,
|
||||
stats: [],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user