mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-14 01:59:05 +03:00
fix: kshook scores shouldn't be marked with user intent
This commit is contained in:
@@ -4,6 +4,7 @@ import FixUndefinedBMSData from "./migrations/fix-undefined-bms-data";
|
||||
import JoinINFCastHourCharts from "./migrations/join-inf-casthour-charts";
|
||||
import JoinINFCastHourSongs from "./migrations/join-inf-casthour-songs";
|
||||
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 RecalcBrokenIIDXNotecounts from "./migrations/recalc-broken-iidx-notecounts";
|
||||
import RemoveIIDXBeginners from "./migrations/remove-iidx-beginners";
|
||||
@@ -45,7 +46,8 @@ if (Environment.nodeEnv !== "test") {
|
||||
UpdateJubeatPreferredTables,
|
||||
JoinINFCastHourCharts,
|
||||
JoinINFCastHourSongs,
|
||||
MarkFervidexAsWithoutIntent
|
||||
MarkFervidexAsWithoutIntent,
|
||||
MarkKsHookAsWithoutIntent
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import db from "external/mongo/db";
|
||||
import type { Migration } from "utils/types";
|
||||
|
||||
const migration: Migration = {
|
||||
id: "mark-fervidex-as-without-intent",
|
||||
up: async () => {
|
||||
await db.imports.update(
|
||||
{
|
||||
importType: { $in: ["ir/kshook-sv6c", "ir/kshook-sv6c-static"] },
|
||||
},
|
||||
{
|
||||
userIntent: false,
|
||||
}
|
||||
);
|
||||
},
|
||||
down: () => {
|
||||
throw new Error(`Unable to revert transaction.`);
|
||||
},
|
||||
};
|
||||
|
||||
export default migration;
|
||||
@@ -27,6 +27,8 @@ t.test("POST /ir/kshook/sv6c/score/save", (t) => {
|
||||
t.equal(res.body.body.scoreIDs.length, 1, "Should import one score.");
|
||||
t.equal(res.body.body.errors.length, 0, "Should have 0 failed scores.");
|
||||
|
||||
t.equal(res.body.body.userIntent, false, "Should not have user intent.");
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
@@ -117,6 +119,7 @@ t.test("POST /ir/kshook/sv6c/score/export", (t) => {
|
||||
t.equal(res.body.success, true);
|
||||
t.equal(res.body.body.scoreIDs.length, 1, "Should import one score.");
|
||||
t.equal(res.body.body.errors.length, 0, "Should have 0 failed scores.");
|
||||
t.equal(res.body.body.userIntent, false, "Should not have user intent.");
|
||||
|
||||
const dbRes = await db["kshook-sv6c-settings"].findOne({
|
||||
userID: 1,
|
||||
|
||||
@@ -83,7 +83,7 @@ router.use(ValidateHeaders);
|
||||
router.post("/score/save", async (req, res) => {
|
||||
const responseData = await ExpressWrappedScoreImportMain(
|
||||
req[SYMBOL_TACHI_API_AUTH].userID!,
|
||||
true,
|
||||
false,
|
||||
"ir/kshook-sv6c",
|
||||
[req.safeBody]
|
||||
);
|
||||
@@ -127,7 +127,7 @@ router.post("/score/export", async (req, res) => {
|
||||
|
||||
const responseData = await ExpressWrappedScoreImportMain(
|
||||
userID,
|
||||
true,
|
||||
false,
|
||||
"ir/kshook-sv6c-static",
|
||||
[req.safeBody]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user