Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-cn-database-generator
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
ygopro-cn-database-generator
Commits
7f3dd2ed
Commit
7f3dd2ed
authored
Aug 24, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mutate
parent
76c5bbb6
Pipeline
#29362
passed with stages
in 1 minute and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/dbreader.ts
src/dbreader.ts
+8
-4
No files found.
src/dbreader.ts
View file @
7f3dd2ed
...
...
@@ -85,7 +85,7 @@ export class Card {
}
return
(
cardType
&
(
0x4000000
|
0x800000
|
0x2000
|
0x40
))
>
0
;
}
async
loadData
(
db
:
Database
,
symbol
:
string
)
{
async
loadData
(
db
:
Database
)
{
this
.
preDatas
=
this
.
datas
;
this
.
preTexts
=
this
.
texts
;
this
.
loadedDatas
=
await
db
.
get
(
"
select * from datas where id = ?
"
,
[
this
.
code
]);
...
...
@@ -98,8 +98,6 @@ export class Card {
...
this
.
loadedTexts
,
...
this
.
preTexts
}
this
.
datas
.
ot
|=
0x8
;
this
.
texts
.
desc
+=
'
\r\n\r\n\
u2605
'
+
symbol
;
}
getSQLQueries
()
{
const
datasArray
=
this
.
getDatasArray
();
...
...
@@ -228,9 +226,15 @@ export class DBReader extends Base {
async
run
(
cards
:
Card
[],
options
:
{
extraBanlists
?:
Banlist
[]
}
=
{})
{
await
Promise
.
all
(
cards
.
map
(
card
=>
card
.
loadData
(
this
.
cndb
,
this
.
config
.
descSymbol
)));
await
Promise
.
all
(
cards
.
map
(
card
=>
card
.
loadData
(
this
.
cndb
)));
const
extendedCards
=
(
await
Promise
.
all
(
cards
.
map
(
card
=>
card
.
getRelatedCards
(
this
.
cndb
)))).
flat
();
const
allCards
=
_
.
uniqBy
(
cards
.
concat
(
extendedCards
),
(
s
)
=>
s
.
code
);
allCards
.
forEach
((
card
)
=>
{
if
(
this
.
config
.
fileSymbol
===
'
cn
'
)
{
card
.
datas
.
ot
|=
0x8
;
}
card
.
texts
.
desc
+=
'
\r\n\r\n\
u2605
'
+
this
.
config
.
descSymbol
;
})
const
queries
=
allCards
.
flatMap
(
card
=>
card
.
getSQLQueries
());
await
this
.
openOutputDatabase
();
await
this
.
outputdb
.
run
(
"
BEGIN TRANSACTION;
"
);
...
...
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