diff --git a/server/.github/FUNDING.yml b/server/.github/FUNDING.yml index 82162eb02..c55044d83 100644 --- a/server/.github/FUNDING.yml +++ b/server/.github/FUNDING.yml @@ -1,7 +1,7 @@ # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: zkldi +patreon: # zkldi open_collective: # Replace with a single Open Collective username ko_fi: zkldi tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel diff --git a/server/CHANGELOG.md b/server/CHANGELOG.md new file mode 100644 index 000000000..374aa0fcd --- /dev/null +++ b/server/CHANGELOG.md @@ -0,0 +1,41 @@ + + + +# Syntax + +| Type | Description | +| :----: | :---------------------------------------------------------------: | +| BUG | This was a bug fix. | +| ENH | This was an enhancement, An improvement to an existing behaviour. | +| FEAT | A new feature. | +| REWORK | An existing feature was reworked/changed. | + +# Changelog + +## 2.1.0 (Ongoing Development) + +- [FEAT] Added Jubeat Support. (#169) +- [FEAT] Added Pop'n Music Support. (#69) +- [FEAT] Added WACCA Support. (#598) +- [FEAT] Added support for Skye's pop'n hook. (#563) + +***** + +- [REWORK] KtRating is no longer the default rating algorithm for IIDX. It has been removed, and the new default is ktLampRating. (#597) + +***** + +- [ENH] Added a CHANGELOG.md file. (#627) +- [ENH] BATCH-MANUAL now supports the `percent` field for jubeat only. (#620) +- [ENH] Add support for jubility. (#163) +- [ENH] Move BPI related data (Kaiden Average and BPI) to IIDX charts, instead of being in a separate collection. This lets us display more stats on the UI. (#599) +- [ENH] Add game specific indexes. (#606) +- [ENH] Ratings are nullable now (#611) +- [ENH] Pre-HV Leggendaria songIDs are now properly resolved. (#487) + +***** + +- [BUG] UpdateClass now records the class as being recently achieved (i.e. display Chuuden -> Kaiden on the UI) (#589) +- [BUG] CHUNITHM's rating calculator no longer over-rewards SS rank scores. (#615) +- [BUG] Folder timelines now pull the oldest score for a given chart, rather than the newest. (#610) +- [BUG] Fixed bug where good plays on 3y3s long would get dropped due to a misunderstanding of a field. (#602) \ No newline at end of file diff --git a/server/src/external/mongo/indexes.ts b/server/src/external/mongo/indexes.ts index bb7cf67fd..c3717106a 100644 --- a/server/src/external/mongo/indexes.ts +++ b/server/src/external/mongo/indexes.ts @@ -63,13 +63,7 @@ const staticIndexes: Partial> = { index({ title: "text", searchTerms: "text" }), ], "kai-auth-tokens": [index({ userID: 1, service: 1 }, UNIQUE)], - "charts-iidx": [ - index( - { "data.arcChartID": 1 }, - { unique: true, partialFilterExpression: { "data.arcChartID": { $type: "string" } } } - ), - index({ "data.hashSHA256": 1 }), - ], + "bms-course-lookup": [index({ md5sums: 1 }, UNIQUE)], "api-tokens": [index({ token: 1 }, UNIQUE), index({ userID: 1 })], tables: [index({ tableID: 1, game: 1, playtype: 1 }, UNIQUE)], @@ -84,6 +78,14 @@ const staticIndexes: Partial> = { counters: [index({ counterName: 1 }, UNIQUE)], "class-achievements": [index({ game: 1, playtype: 1, timeAchieved: 1 })], "api-clients": [index({ clientID: 1 }, UNIQUE)], + "charts-iidx": [ + index( + { "data.arcChartID": 1 }, + { unique: true, partialFilterExpression: { "data.arcChartID": { $type: "string" } } } + ), + index({ "data.hashSHA256": 1 }), + index({ "data.inGameID": 1, playtype: 1, difficulty: 1 }), + ], "charts-bms": [index({ "data.hashMD5": 1 }, UNIQUE), index({ "data.hashSHA256": 1 }, UNIQUE)], "charts-popn": [index({ "data.hashSHA256": 1 }, UNIQUE)], "charts-sdvx": [index({ "data.inGameID": 1, difficulty: 1 }, UNIQUE)], diff --git a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts index f1fd84fd7..3ee00c05e 100644 --- a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts +++ b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts @@ -69,6 +69,7 @@ const SUPPORTED_BMS_CLIENTS = [ "LR2oraja 0.8.2", "LR2oraja 0.8.1", "LR2oraja 0.8.0", + "LR2oraja(rekidai.info) 0.8.4", "LR2oraja(rekidai.info) 0.8.3", "LR2oraja(rekidai.info) 0.8.2", "LR2oraja(rekidai.info) 0.8.1", diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts b/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts index 45a454673..f710cea1f 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts @@ -91,7 +91,7 @@ function ConvertRandom( random: LR2HookScore["playerData"]["random"] ): ScoreDocument<"bms:7K">["scoreMeta"]["random"] { switch (random) { - case "NONRAN": + case "NORAN": return "NONRAN"; case "MIRROR": return "MIRROR"; diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts b/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts index 9d42f4e83..9649e2830 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts @@ -5,7 +5,7 @@ import p, { PrudenceSchema } from "prudence"; import ScoreImportFatalError from "lib/score-import/framework/score-importing/score-import-error"; import { FormatPrError } from "utils/prudence"; -const SUPPORTED_RANDOMS = ["NONRAN", "MIRROR", "RAN", "S-RAN"]; +const SUPPORTED_RANDOMS = ["NORAN", "MIRROR", "RAN", "S-RAN"]; const PR_LR2Hook: PrudenceSchema = { md5: "string", diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/types.ts b/server/src/lib/score-import/import-types/ir/lr2hook/types.ts index edcf99825..4be600234 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/types.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/types.ts @@ -5,7 +5,7 @@ export interface LR2HookScore { playerData: { autoScr: 0; gameMode: unknown; - random: "NONRAN" | "MIRROR" | "RAN" | "S-RAN"; + random: "NORAN" | "MIRROR" | "RAN" | "S-RAN"; gauge: "GROOVE" | "HAZARD" | "HARD" | "EASY" | "P-ATTACK" | "G-ATTACK"; }; scoreData: { diff --git a/server/src/lib/score-mutation/update-score.test.ts b/server/src/lib/score-mutation/update-score.test.ts index 79a28c6b9..d304186f6 100644 --- a/server/src/lib/score-mutation/update-score.test.ts +++ b/server/src/lib/score-mutation/update-score.test.ts @@ -64,8 +64,12 @@ t.test("#UpdateScore", (t) => { scoreData: { score: 1020 }, } as any); + delete score._id; + const newScoreID = CreateScoreID(score.userID, score, score.chartID); + rootLogger.crit(newScoreID); + await db.imports.insert(mockImportDocument); await db.sessions.insert(mockSessionDocument); diff --git a/server/src/lib/score-mutation/update-score.ts b/server/src/lib/score-mutation/update-score.ts index 032cc520c..c0ae9cdbe 100644 --- a/server/src/lib/score-mutation/update-score.ts +++ b/server/src/lib/score-mutation/update-score.ts @@ -4,6 +4,7 @@ import { KtLogger, rootLogger } from "lib/logger/logger"; import { CreateCalculatedData } from "lib/score-import/framework/calculated-data/calculated-data"; import { UpdateChartRanking } from "lib/score-import/framework/pb/create-pb-doc"; import { CreateScoreID } from "lib/score-import/framework/score-importing/score-id"; +import { id } from "monk"; import { ScoreDocument } from "tachi-common"; import { UpdateAllPBs } from "utils/calculations/recalc-scores"; import { FormatUserDoc, GetUserWithID } from "utils/user"; @@ -67,6 +68,8 @@ export default async function UpdateScore(oldScore: ScoreDocument, newScore: Sco ); try { + // Having _id defined will cause this to throw, causing it to not apply + // the update. if (newScore._id) { logger.warn( `Passed a score with _id to UpdateScore. This property should not be set. Deleting this property and continuing anyway.`