@@ -35,7 +35,7 @@ export const receiptText = (
35
35
) => encoder
36
36
. initialize ( )
37
37
. codepage ( 'cp936' )
38
- . setPinterType ( 80 ) // wrong typo in the library
38
+ . setPinterType ( config . balloonType ?? 80 ) // wrong typo in the library
39
39
. align ( 'center' )
40
40
. bold ( true )
41
41
. size ( 2 )
@@ -45,7 +45,7 @@ export const receiptText = (
45
45
. emptyLine ( 1 )
46
46
. bold ( false )
47
47
. size ( 1 )
48
- . line ( '=========================================== ' )
48
+ . line ( '===============================' )
49
49
. emptyLine ( 1 )
50
50
. oneLine ( i18n [ lang ] . location , location )
51
51
. oneLine ( i18n [ lang ] . problem , problem )
@@ -54,7 +54,7 @@ export const receiptText = (
54
54
. emptyLine ( 1 )
55
55
. align ( 'center' )
56
56
. bold ( true )
57
- . line ( '=========================================== ' )
57
+ . line ( '================================' )
58
58
. emptyLine ( 2 )
59
59
. size ( 0 )
60
60
. line ( `${ i18n [ lang ] . team } : ${ teamname } ` )
@@ -76,7 +76,7 @@ async function printBalloon(doc, lang) {
76
76
doc . balloonid ,
77
77
doc . location ? doc . location : 'N/A' ,
78
78
doc . problem ,
79
- lang === 'zh' ? convertToChinese ( doc . contestproblem . color ) : doc . contestproblem . color ,
79
+ lang === 'zh' ? await convertToChinese ( doc . contestproblem . color ) : doc . contestproblem . color ,
80
80
doc . awards ? doc . awards : 'N/A' ,
81
81
doc . team ,
82
82
doc . total ? Object . keys ( doc . total ) . map ( ( k ) => `- ${ k } : ${ doc . total [ k ] . color } ` ) . join ( '\n' ) : 'N/A' ,
@@ -94,7 +94,7 @@ async function fetchTask(c) {
94
94
if ( body . balloons ) {
95
95
for ( const doc of body . balloons ) {
96
96
logger . info ( `Print balloon task ${ doc . teamid } #${ doc . balloonid } ...` ) ;
97
- await printBalloon ( doc , config . receiptLang ) ;
97
+ await printBalloon ( doc , config . balloonLang ) ;
98
98
await post ( `${ c . server } /client/${ c . token } /doneballoon/${ doc . balloonid } ` ) ;
99
99
logger . info ( `Print task ${ doc . teamid } #${ doc . balloonid } completed.` ) ;
100
100
}
0 commit comments