Fix: Harden the filter to insert only basic cards into database
This commit is contained in:
parent
29411757cb
commit
6103a9511e
2 changed files with 6 additions and 17 deletions
|
@ -157,19 +157,11 @@ async function createJson() {
|
|||
})
|
||||
|
||||
console.log("Exporting stats...")
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
writeFileSync("/app/data/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
}
|
||||
writeFileSync(import.meta.dirname + "/../data/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
|
||||
for (const index of Object.keys(commanderData)) {
|
||||
let JSONToWrite = commanderData[index].sort((a,b) => b.nbr_decks - a.nbr_decks)
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
writeFileSync("/app/data/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
writeFileSync(import.meta.dirname + "/../data/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
|
||||
for (const index of Object.keys(bset_cards_data_export)) {
|
||||
|
@ -177,11 +169,7 @@ async function createJson() {
|
|||
for (const type of Object.keys(JSONToWrite)) {
|
||||
JSONToWrite[type] = JSONToWrite[type].sort((a,b) => b.nbr_decks - a.nbr_decks)
|
||||
}
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
writeFileSync("/app/data/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
writeFileSync(import.meta.dirname + "/../data/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
const end = performance.now()
|
||||
console.log(`Time taken to generate stats is ${end - start}ms.`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue