Skip to content

Commit fba6b25

Browse files
committed
fix hydro balloon id is toooo long
1 parent ed4b0da commit fba6b25

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/server/client/balloon.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ export const receiptBalloonText = (
3737
.codepage('cp936')
3838
.setPinterType(config.balloonType ?? 80) // wrong typo in the library
3939
.align('center')
40+
.line('')
4041
.bold(true)
4142
.size(2)
4243
.line(i18n[lang].receipt)
4344
.emptyLine(1)
44-
.line(`ID: ${id}`)
45+
.line(`ID: ${String(id).substring(0, 8)}`)
4546
.emptyLine(1)
4647
.bold(false)
4748
.size(1)
@@ -55,14 +56,14 @@ export const receiptBalloonText = (
5556
.align('center')
5657
.bold(true)
5758
.line('================================')
58-
.emptyLine(2)
59+
.emptyLine(1)
5960
.size(0)
6061
.line(`${i18n[lang].team}: ${teamname}`)
6162
.line(`${i18n[lang].status}:`)
6263
.line(`${status}`)
63-
.emptyLine(2)
64+
.emptyLine(1)
6465
.line('Powered by hydro-dev/xcpc-tools')
65-
.emptyLine(3)
66+
.emptyLine(2)
6667
.cut()
6768
.encode();
6869

packages/server/service/fetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ class HydroFetcher extends BasicFetcher {
223223
rgb: this.contest.info.balloon[balloon.pid].color,
224224
color: this.contest.info.balloon[balloon.pid].name,
225225
};
226-
await this.ctx.db.balloon.update({ balloonid: balloon._id.substring(0, 8) }, {
226+
await this.ctx.db.balloon.update({ balloonid: balloon._id }, {
227227
$set: {
228-
balloonid: balloon._id.substring(0, 8),
228+
balloonid: balloon._id,
229229
time: balloon.time,
230230
problem: contestproblem.short_name,
231231
contestproblem,

0 commit comments

Comments
 (0)