diff --git a/server/src/lib/migration/migrations.ts b/server/src/lib/migration/migrations.ts index 511fe2934..0bc344cbc 100644 --- a/server/src/lib/migration/migrations.ts +++ b/server/src/lib/migration/migrations.ts @@ -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 ); } diff --git a/server/src/lib/migration/migrations/mark-kshook-as-without-intent.ts b/server/src/lib/migration/migrations/mark-kshook-as-without-intent.ts new file mode 100644 index 000000000..755079110 --- /dev/null +++ b/server/src/lib/migration/migrations/mark-kshook-as-without-intent.ts @@ -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; diff --git a/server/src/server/router/ir/kshook/sv6c/router.test.ts b/server/src/server/router/ir/kshook/sv6c/router.test.ts index ad1006642..d7ada18fd 100644 --- a/server/src/server/router/ir/kshook/sv6c/router.test.ts +++ b/server/src/server/router/ir/kshook/sv6c/router.test.ts @@ -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, diff --git a/server/src/server/router/ir/kshook/sv6c/router.ts b/server/src/server/router/ir/kshook/sv6c/router.ts index 74db5a8e2..f9dffd655 100644 --- a/server/src/server/router/ir/kshook/sv6c/router.ts +++ b/server/src/server/router/ir/kshook/sv6c/router.ts @@ -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] );