diff --git a/server/package.json b/server/package.json index 01887429d..a093077e2 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "tachi-server", - "version": "2.0.10", + "version": "2.0.13", "description": "A score tracking server.", "main": "js/index.js", "private": true, @@ -83,7 +83,7 @@ "rimraf": "3.0.2", "safe-json-stringify": "1.2.0", "seq-logging": "^1.1.1", - "tachi-common": "0.3.21", + "tachi-common": "0.3.22", "ts-node": "10.0.0", "typescript": "4.3.4", "winston": "3.3.3", diff --git a/server/pnpm-lock.yaml b/server/pnpm-lock.yaml index c2b70ddc0..8bea94550 100644 --- a/server/pnpm-lock.yaml +++ b/server/pnpm-lock.yaml @@ -63,7 +63,7 @@ specifiers: safe-json-stringify: 1.2.0 seq-logging: ^1.1.1 supertest: 6.1.3 - tachi-common: 0.3.21 + tachi-common: 0.3.22 tap: 15.0.9 ts-node: 10.0.0 tsconfig-paths: 3.10.1 @@ -107,7 +107,7 @@ dependencies: rimraf: 3.0.2 safe-json-stringify: 1.2.0 seq-logging: 1.1.1 - tachi-common: 0.3.21 + tachi-common: 0.3.22 ts-node: 10.0.0_83f53b0a0c5616d3fa00ed4e30b9ce1b typescript: 4.3.4 winston: 3.3.3 @@ -5387,8 +5387,8 @@ packages: strip-ansi: 6.0.0 dev: true - /tachi-common/0.3.21: - resolution: {integrity: sha512-gOaqyEMLrDr0xpmtVqjAYqdY+NgbpaVHZlt0g0v+nmKDMG9gyrqd99alUApUb/o0zzLd8o2uediajgWGcDTCFw==} + /tachi-common/0.3.22: + resolution: {integrity: sha512-nLt1wv65wY5WdB/QXuVNeOOgA8r2c8OrohGEKyylE5wRyWIA8wOVsZJGPxi9Uxm0TqeVDXwBRV8CyV97czZAMA==} dependencies: monk: 7.3.4 transitivePeerDependencies: diff --git a/server/scripts/single-use/recalc-chunithm-scores.ts b/server/scripts/single-use/recalc-chunithm-scores.ts index 84592f80d..db1302755 100644 --- a/server/scripts/single-use/recalc-chunithm-scores.ts +++ b/server/scripts/single-use/recalc-chunithm-scores.ts @@ -9,7 +9,7 @@ const logger = CreateLogCtx(__filename); if (require.main === module) { let i = 0; db.scores - .find({ game: "chunithm", "scoreData.grade": "SS" }) + .find({ game: "chunithm", "scoreData.grade": null }) // @ts-expect-error dumb .each(async (oldScore, { pause, resume }) => { pause(); diff --git a/server/src/lib/constants/version.ts b/server/src/lib/constants/version.ts index 851ef7778..379912495 100644 --- a/server/src/lib/constants/version.ts +++ b/server/src/lib/constants/version.ts @@ -4,7 +4,7 @@ const MAJOR = 2; const MINOR = 0; -const PATCH = 10; +const PATCH = 13; // As is with all front-facing zkldi projects, the version names for tachi-server // are from an album I like. In this case, the album is Portishead - Dummy. diff --git a/server/src/lib/score-import/framework/common/score-utils.test.ts b/server/src/lib/score-import/framework/common/score-utils.test.ts new file mode 100644 index 000000000..dab0021ea --- /dev/null +++ b/server/src/lib/score-import/framework/common/score-utils.test.ts @@ -0,0 +1,33 @@ +import t from "tap"; +import { GetGradeFromPercent } from "./score-utils"; + +t.test("#GetGradeForPercent", (t) => { + t.equal( + GetGradeFromPercent("chunithm", "Single", 101), + "SSS", + "Should return SSS for the edge case of chunithms 101% == SS." + ); + t.equal( + GetGradeFromPercent("iidx", "SP", 100), + "MAX", + "Should return SSS for the edge case of 100% == MAX (iidx SP)." + ); + t.equal( + GetGradeFromPercent("iidx", "DP", 100), + "MAX", + "Should return SSS for the edge case of 100% == MAX (iidx DP)." + ); + + t.equal( + GetGradeFromPercent("iidx", "SP", 0), + "F", + "Should return SSS for the edge case of 0% == F (iidx SP)." + ); + t.equal( + GetGradeFromPercent("iidx", "DP", 0), + "F", + "Should return SSS for the edge case of 0% == F (iidx DP)." + ); + + t.end(); +});