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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
srvpro
Commits
c13360ae
Commit
c13360ae
authored
Mar 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
bcfe4525
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
.gitignore
.gitignore
+1
-0
ygopro-deck-stats.js
ygopro-deck-stats.js
+5
-7
No files found.
.gitignore
View file @
c13360ae
# ignore
test*
config.deckstats.json
node_modules/.bin/
node_modules/bunyan/
...
...
ygopro-deck-stats.js
View file @
c13360ae
...
...
@@ -8,11 +8,9 @@
*/
var
sqlite3
=
require
(
'
sqlite3
'
).
verbose
();
var
fs
=
require
(
'
fs
'
);
var
config
=
require
(
'
./config.deckstats.json
'
);
//{ "deckpath": "../decks", "dbfile": "cards.cdb" }
var
constants
=
require
(
'
./constants.json
'
);
var
DECKPATH
=
"
C:
\\
deck
\\
deck
"
var
DBFILE
=
"
F:
\\
Works
\\
deck
\\
cards.cdb
"
var
ALL_MAIN_CARDS
=
{};
var
ALL_SIDE_CARDS
=
{};
var
ALL_CARD_DATAS
=
{};
...
...
@@ -46,7 +44,7 @@ function add_to_all_list(LIST,id,use) {
function
read_deck_file
(
filename
)
{
console
.
log
(
"
reading
"
+
filename
);
var
deck_text
=
fs
.
readFileSync
(
DECKPATH
+
"
\\
"
+
filename
,{
encoding
:
"
ASCII
"
})
var
deck_text
=
fs
.
readFileSync
(
config
.
deckpath
+
"
\\
"
+
filename
,{
encoding
:
"
ASCII
"
})
var
deck_array
=
deck_text
.
split
(
"
\n
"
);
var
deck_main
=
{};
var
deck_side
=
{};
...
...
@@ -68,10 +66,10 @@ function read_deck_file(filename) {
}
function
load_database
(
callback
)
{
var
db
=
new
sqlite3
.
Database
(
DBFILE
);
var
db
=
new
sqlite3
.
Database
(
config
.
dbfile
);
db
.
each
(
"
select * from datas,texts where datas.id=texts.id
"
,
function
(
err
,
result
)
{
if
(
err
)
{
console
.
log
(
DBFILE
+
"
:
"
+
err
);
console
.
log
(
config
.
dbfile
+
"
:
"
+
err
);
return
;
}
else
{
...
...
@@ -141,7 +139,7 @@ function load_database(callback) {
}
function
read_decks
()
{
var
ALL_DECKS
=
fs
.
readdirSync
(
DECKPATH
);
var
ALL_DECKS
=
fs
.
readdirSync
(
config
.
deckpath
);
for
(
var
i
in
ALL_DECKS
)
{
var
filename
=
ALL_DECKS
[
i
];
...
...
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