feat: remove >100% scores

i'm ill as fuck man
This commit is contained in:
zkldi
2024-12-05 12:11:12 +00:00
parent 08177b6027
commit e4e62e37de
3 changed files with 31 additions and 2 deletions
+4 -1
View File
@@ -7,10 +7,13 @@ mod docs
interactive:
-@just --choose
install:
pnpm install
# Run the frontend and backend for Tachi.
#
# This is the main command you want to use to start up tachi. Go for it!
start:
start: install
parallel --lb ::: 'FORCE_COLOR=1 just server start' 'FORCE_COLOR=1 just client start'
# test everything
+7 -1
View File
@@ -9,6 +9,7 @@ import KtRatingToCuratorSkill from "./migrations/ktRating-to-curator-skill";
import MarkFervidexAsWithoutIntent from "./migrations/mark-fervidex-as-without-intent";
import MarkKsHookAsWithoutIntent from "./migrations/mark-kshook-as-without-intent";
import NullLR2HookFailedBPs from "./migrations/null-lr2hook-failed-bps";
import RemoveAbove100pc from "./migrations/remove-above-100pc";
import RemoveIIDXBeginners from "./migrations/remove-iidx-beginners";
import RemoveIIDX2dxtraBeginners from "./migrations/remove-iidx-extra-beginners";
import RemoveMultifolderStats from "./migrations/remove-multifolder-stats";
@@ -74,7 +75,12 @@ if (Environment.nodeEnv !== "test") {
// bokutachi specific migrations
if (TachiConfig.TYPE !== "kamai") {
REGISTERED_MIGRATIONS.push(NullLR2HookFailedBPs, FixUndefinedBMSData, RemoveRandom);
REGISTERED_MIGRATIONS.push(
NullLR2HookFailedBPs,
FixUndefinedBMSData,
RemoveRandom,
RemoveAbove100pc
);
}
}
@@ -0,0 +1,20 @@
import db from "external/mongo/db";
import { DeleteMultipleScores } from "lib/score-mutation/delete-scores";
import type { Migration } from "utils/types";
const migration: Migration = {
id: "remove-above-100pc",
up: async () => {
const toDelete = await db.scores.find({
game: "bms",
"scoreData.percent": { $gt: 100.0 },
});
await DeleteMultipleScores(toDelete);
},
down: () => {
throw new Error(`Reverting this change is not possible.`);
},
};
export default migration;