mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix oi first ac calc
This commit is contained in:
1 file changed
+5
-2
@@ -367,6 +367,7 @@ const oi = buildContestRule({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const tsddict = ((config.lockAt && isLocked(tdoc, new Date())) ? tsdoc.display : tsdoc.detail) || {};
|
const tsddict = ((config.lockAt && isLocked(tdoc, new Date())) ? tsdoc.display : tsdoc.detail) || {};
|
||||||
|
const useRelativeTime = !!tdoc.duration;
|
||||||
for (const pid of tdoc.pids) {
|
for (const pid of tdoc.pids) {
|
||||||
const index = `${tsdoc.uid}/${tdoc.domainId}/${pid}`;
|
const index = `${tsdoc.uid}/${tdoc.domainId}/${pid}`;
|
||||||
|
|
||||||
@@ -394,7 +395,8 @@ const oi = buildContestRule({
|
|||||||
score: tsddict[pid]?.score,
|
score: tsddict[pid]?.score,
|
||||||
};
|
};
|
||||||
if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED) {
|
if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED) {
|
||||||
if (tsddict[pid].rid.getTimestamp().getTime() - (tsdoc.startAt || tdoc.beginAt).getTime() === meta?.first?.[pid]) {
|
const startAt = (useRelativeTime ? tsdoc.startAt || tdoc.beginAt : tdoc.beginAt).getTime();
|
||||||
|
if (tsddict[pid].rid.getTimestamp().getTime() - startAt === meta?.first?.[pid]) {
|
||||||
node.style = 'background-color: rgb(217, 240, 199);';
|
node.style = 'background-color: rgb(217, 240, 199);';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,10 +410,11 @@ const oi = buildContestRule({
|
|||||||
const udict = await user.getListForRender(tdoc.domainId, uids, config.showDisplayName ? ['displayName'] : []);
|
const udict = await user.getListForRender(tdoc.domainId, uids, config.showDisplayName ? ['displayName'] : []);
|
||||||
const psdict = {};
|
const psdict = {};
|
||||||
const first = {};
|
const first = {};
|
||||||
|
const useRelativeTime = !!tdoc.duration;
|
||||||
for (const [, tsdoc] of rankedTsdocs) {
|
for (const [, tsdoc] of rankedTsdocs) {
|
||||||
for (const [pid, detail] of Object.entries(tsdoc.detail || {})) {
|
for (const [pid, detail] of Object.entries(tsdoc.detail || {})) {
|
||||||
if (detail.status !== STATUS.STATUS_ACCEPTED) continue;
|
if (detail.status !== STATUS.STATUS_ACCEPTED) continue;
|
||||||
const time = detail.rid.getTimestamp().getTime() - (tsdoc.startAt || tdoc.beginAt).getTime();
|
const time = detail.rid.getTimestamp().getTime() - (useRelativeTime ? tsdoc.startAt || tdoc.beginAt : tdoc.beginAt).getTime();
|
||||||
if (!first[pid] || first[pid] > time) first[pid] = time;
|
if (!first[pid] || first[pid] > time) first[pid] = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user