Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
tabulator-another
Commits
8863ec48
Commit
8863ec48
authored
May 21, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c913fda2
Pipeline
#36621
passed with stages
in 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
src/participant/entities/participant.entity.ts
src/participant/entities/participant.entity.ts
+3
-0
src/tournament/tournament.service.ts
src/tournament/tournament.service.ts
+24
-2
No files found.
src/participant/entities/participant.entity.ts
View file @
8863ec48
...
...
@@ -89,6 +89,9 @@ export class Participant extends NamedBase {
deckbuf
?:
string
;
isValidInCreate
()
{
if
(
this
[
'
_invalid
'
])
{
return
this
[
'
_invalid
'
]
as
string
;
}
if
(
this
.
deckbuf
)
{
try
{
const
buf
=
Buffer
.
from
(
this
.
deckbuf
,
'
base64
'
);
...
...
src/tournament/tournament.service.ts
View file @
8863ec48
...
...
@@ -283,11 +283,30 @@ export class TournamentService extends CrudService(Tournament, {
});
}
const
addInvalid
=
(
name
:
string
,
reason
:
string
)
=>
{
const
participant
=
new
Participant
();
participant
.
name
=
name
.
split
(
'
/
'
)
.
pop
()
.
replace
(
/
(\.
ydk
)
+$/i
,
''
);
participant
.
tournamentId
=
id
;
participant
.
quit
=
false
;
participant
.
deckbuf
=
undefined
;
participant
[
'
_invalid
'
]
=
reason
;
participants
.
push
(
participant
);
};
const
deckObs
=
parseZipStream
(
zipStreamRes
.
data
,
(
e
)
=>
e
.
type
===
'
File
'
&&
e
.
path
.
endsWith
(
'
.ydk
'
)
,
(
e
)
=>
e
.
type
===
'
File
'
,
).
pipe
(
mergeMap
(
async
(
e
)
=>
{
if
(
!
e
.
path
.
endsWith
(
'
.ydk
'
))
{
// 非 YDK 文件,跳过
addInvalid
(
e
.
path
,
'
非 YDK 文件
'
);
e
.
autodrain
();
return
null
;
}
try
{
const
content
=
await
streamToBuffer
(
e
);
...
...
@@ -298,6 +317,7 @@ export class TournamentService extends CrudService(Tournament, {
};
}
catch
(
err
)
{
this
.
log
.
error
(
`Error reading file
${
e
.
path
}
:
${
err
}
`
);
addInvalid
(
e
.
path
,
'
读取文件失败
'
);
return
null
;
}
}),
...
...
@@ -314,7 +334,9 @@ export class TournamentService extends CrudService(Tournament, {
.
split
(
'
/
'
)
.
pop
()
.
replace
(
/
(\.
ydk
)
+$/i
,
''
);
if
(
!
participant
.
name
.
length
)
return
;
if
(
!
participant
.
name
.
length
)
{
participant
[
'
_invalid
'
]
=
'
选手名称无效
'
;
}
participant
.
tournamentId
=
id
;
participant
.
deckbuf
=
Buffer
.
from
(
YGOProDeck
.
fromYdkString
(
text
).
toUpdateDeckPayload
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment