Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
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
nanahira
srvpro
Commits
fed1ff8c
Commit
fed1ff8c
authored
Feb 14, 2026
by
水濑真白
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
b9c3a5ad
3b813a9b
Pipeline
#43211
failed with stages
in 103 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
ygopro-tournament.ts
ygopro-tournament.ts
+25
-16
No files found.
ygopro-tournament.ts
View file @
fed1ff8c
...
...
@@ -165,29 +165,38 @@ const receiveDecks = async function (
callback
:
(
err
:
Error
|
null
,
result
:
Array
<
{
file
:
string
;
status
:
string
}
>
)
=>
void
)
{
try
{
// formidable parse() 返回的 files 通常是对象:{ fieldName: File | File[] }
// 老代码按数组 for..of 会直接抛:TypeError: files is not iterable
const
fileList
:
any
[]
=
Array
.
isArray
(
files
)
?
files
:
files
&&
typeof
files
===
"
object
"
?
Object
.
values
(
files
).
flatMap
((
v
:
any
)
=>
(
Array
.
isArray
(
v
)
?
v
:
[
v
]))
:
[];
const
result
:
Array
<
{
file
:
string
;
status
:
string
}
>
=
[];
for
(
const
file
of
files
)
{
if
(
file
.
name
.
endsWith
(
"
.ydk
"
))
{
const
deck
=
await
readDeck
(
file
.
name
,
file
.
path
);
for
(
const
f
of
fileList
)
{
const
filename
:
string
=
(
f
?.
originalFilename
??
f
?.
name
??
""
)
as
string
;
const
filepath
:
string
=
(
f
?.
filepath
??
f
?.
path
??
""
)
as
string
;
if
(
!
filename
||
!
filepath
)
{
result
.
push
({
file
:
filename
||
"
(unknown)
"
,
status
:
"
上传文件信息缺失
"
});
continue
;
}
if
(
filename
.
endsWith
(
"
.ydk
"
))
{
const
deck
=
await
readDeck
(
filename
,
filepath
);
if
(
deck
.
main
.
length
>=
40
)
{
fs
.
createReadStream
(
file
.
path
).
pipe
(
fs
.
createWriteStream
(
config
.
deck_path
+
file
.
name
));
result
.
push
({
file
:
file
.
name
,
status
:
"
OK
"
,
});
fs
.
createReadStream
(
filepath
).
pipe
(
fs
.
createWriteStream
(
config
.
deck_path
+
filename
));
result
.
push
({
file
:
filename
,
status
:
"
OK
"
});
}
else
{
result
.
push
({
file
:
file
.
name
,
status
:
"
卡组不合格
"
,
});
result
.
push
({
file
:
filename
,
status
:
"
卡组不合格
"
});
}
}
else
{
result
.
push
({
file
:
file
.
name
,
status
:
"
不是卡组文件
"
,
});
result
.
push
({
file
:
filename
,
status
:
"
不是卡组文件
"
});
}
}
callback
(
null
,
result
);
}
catch
(
err
)
{
callback
(
err
as
Error
,
[]);
...
...
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