Skip to content

Commit 9f04cd8

Browse files
committed
fix hydro team location
1 parent ec2c218 commit 9f04cd8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/server/service/fetcher.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,17 @@ class HydroFetcher extends BasicFetcher {
235235
rgb: this.contest.info.balloon[balloon.pid].color,
236236
color: this.contest.info.balloon[balloon.pid].name,
237237
};
238+
const udoc = body.udict[balloon.uid];
238239
await this.ctx.db.balloon.update({ balloonid: balloon._id }, {
239240
$set: {
240241
balloonid: balloon._id,
241242
time: balloon.time,
242243
problem: contestproblem.short_name,
243244
contestproblem,
244-
team: body.udict[balloon.uid].displayName,
245+
team: udoc.displayName || udoc.uname,
245246
teamid: balloon.uid,
246-
location: body.udict[balloon.uid].uname,
247-
affiliation: body.udict[balloon.uid].school,
247+
location: udoc.seat || udoc.studentId,
248+
affiliation: udoc.school,
248249
awards: balloon.first ? 'First of Problem' : (
249250
this.contest.info.freeze_time && (balloon.time * 1000) > this.contest.info.freeze_time
250251
&& encourage ? 'Encourage Balloon' : ''
@@ -278,7 +279,7 @@ class HydroFetcher extends BasicFetcher {
278279
id: task._id,
279280
tid: task.owner,
280281
team: `${udoc.school ? `${udoc.school}: ` : ''}${udoc.displayName || udoc.uname}`,
281-
location: udoc.studentId,
282+
location: udoc.seat || udoc.studentId,
282283
filename: task.title,
283284
lang: task.title.split('.').pop() || 'txt',
284285
createdAt: new Date(parseInt(task._id.substring(0, 8), 16) * 1000).getTime(),

0 commit comments

Comments
 (0)