From 1e0d6d91488b49f6089c6e4a0de6b76d36af6b30 Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 27 Aug 2021 22:14:05 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=BF=AE=E5=A4=8D=E8=B7=A8=E5=9F=9F?= =?UTF-8?q?=E5=BC=95=E9=A2=98=E7=9B=AE=E6=97=B6=E8=AE=A2=E9=A2=98=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/model/contest.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index aff8f19d2..4baf0dace 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.33.12", + "version": "2.33.13", "bin": "bin/hydrooj.js", "main": "src/loader", "module": "src/loader", diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index 6f2ffc3f7..d1d04447a 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -219,7 +219,7 @@ const oi: ContestRule = { ); for (const tpsdoc of psdocs) { for (const psdoc of tpsdoc) { - psdict[`${psdoc.uid}/${psdoc.docId}`] = psdoc; + psdict[`${psdoc.uid}/${psdoc.domainId}/${psdoc.docId}`] = psdoc; } } } @@ -236,8 +236,11 @@ const oi: ContestRule = { { type: 'string', value: tsdoc.score || 0 }, ); for (const pid of tdoc.pids) { + const index = pid.toString().includes(':') + ? `${tsdoc.uid}/${pid.toString().replace(':', '/')}` + : `${tsdoc.uid}/${tdoc.domainId}/${pid}`; // eslint-disable-next-line @typescript-eslint/no-use-before-define - if (isDone(tdoc) && tsddict[pid]?.rid?.toHexString() !== psdict[`${tsdoc.uid}/${pid}`]?.rid?.toHexString()) { + if (isDone(tdoc) && tsddict[pid]?.rid?.toHexString() !== psdict[index]?.rid?.toHexString()) { row.push({ type: 'records', value: '', @@ -247,8 +250,8 @@ const oi: ContestRule = { raw: tsddict[pid]?.rid || null, }, { - value: psdict[`${tsdoc.uid}/${pid}`]?.score ?? '-', - raw: psdict[`${tsdoc.uid}/${pid}`]?.rid ?? null, + value: psdict[index]?.score ?? '-', + raw: psdict[index]?.rid ?? null, }, ], });