diff --git a/server/src/lib/score-import/import-types/ir/usc/converter.ts b/server/src/lib/score-import/import-types/ir/usc/converter.ts index 82b4e7204..27955b397 100644 --- a/server/src/lib/score-import/import-types/ir/usc/converter.ts +++ b/server/src/lib/score-import/import-types/ir/usc/converter.ts @@ -88,7 +88,7 @@ export const ConverterIRUSC: ConverterFunction = a if (!chartDoc) { throw new KTDataNotFoundFailure( - `Chart ${context.chartHash} is orphaned.`, + `Chart ${context.chartHash} is not on the IR.`, "ir/usc", data, context diff --git a/server/src/server/router/ir/usc/_playtype/router.ts b/server/src/server/router/ir/usc/_playtype/router.ts index 7c4a148f7..cb717a423 100644 --- a/server/src/server/router/ir/usc/_playtype/router.ts +++ b/server/src/server/router/ir/usc/_playtype/router.ts @@ -305,55 +305,6 @@ router.post("/scores", RequirePermissions("submit_score"), async (req, res) => { playtype, })) as ChartDocument<"usc:Controller" | "usc:Keyboard"> | null; - // if (!chartDoc) { - // return res.status(200).json({ - // statusCode: STATUS_CODES.CHART_REFUSE, - // description: - // "The IR doesn't recognise this chart, and automatic chart uploading has been turned off.", - // }); - // } - - // If the chart doesn't exist, call HandleOrphanQueue. - // If this chart has never been seen before, orphan it. - // If this chart is already orphaned, increase its unique player - // playcount. - // if (!chartDoc) { - // const { song, chart } = ConvertUSCChart(uscChart, playtype); - - // const uscChartName = `${uscChart.artist} - ${uscChart.title} (${USCChartIndexToDiff( - // uscChart.difficulty - // )})`; - - // chartDoc = await HandleOrphanQueue( - // `usc:${playtype}` as const, - // "usc", - // chart, - // song, - // { - // "chartDoc.data.hashSHA1": uscChart.chartHash, - // "chartDoc.playtype": playtype, - // }, - // ServerConfig.USC_QUEUE_SIZE, - // req[SYMBOL_TachiAPIAuth].userID!, - // uscChartName - // ); - - // if (chartDoc) { - // const blacklist = await GetBlacklist(); - // const scoresToDeorphan = await db["orphan-scores"].find({ - // "context.chartHash": chartDoc.data.hashSHA1, - // "context.playtype": playtype, - // }); - - // for (const score of scoresToDeorphan) { - // // Has to be like this to avoid race conditions where two - // // orphans resolve to the same scoreID and collide in mid-air! - // // eslint-disable-next-line no-await-in-loop - // await ReprocessOrphan(score, blacklist, logger); - // } - // } - // } - const userID = req[SYMBOL_TachiAPIAuth]!.userID!; const importRes = await ExpressWrappedScoreImportMain(userID, false, "ir/usc", [ @@ -395,7 +346,7 @@ router.post("/scores", RequirePermissions("submit_score"), async (req, res) => { if (!chartDoc) { return res.status(200).json({ statusCode: STATUS_CODES.ACCEPTED, - description: `This score has been accepted, but the chart is unavailable right now.`, + description: `This score has been saved, but the chart is not currently on the IR.`, body: {}, }); } @@ -414,13 +365,9 @@ router.post("/scores", RequirePermissions("submit_score"), async (req, res) => { } if (!importDoc.scoreIDs[0]) { - logger.warn(`No scoreID, but import was successful?`, { - importDoc, - userID, - }); return res.status(200).json({ - statusCode: STATUS_CODES.BAD_REQ, - description: "No score was imported.", + statusCode: STATUS_CODES.SUCCESS, + description: "Score was identical to another score you already have.", }); }