Commit fde04e3c authored by nanahira's avatar nanahira

finish

parent 9eed3194
const fs = require('fs');
const sqlite3 = require('sqlite3').verbose();
//const sqlite3 = require('sqlite3').verbose();
//const iconv = require('iconv-lite');
//const convert = require('encoding').convert
const dbfile = process.argv[3];
const fpath = process.argv[2];
var all_songs = [];
......@@ -17,6 +16,10 @@ const courseTypes = {
"edit": "ura"
}
function get_sql(song) {
return "INSERT INTO songs VALUES("+song.song_id+",'"+song.title+"',NULL,"+(song.subtitle ? "'"+song.subtitle+"'" : "NULL")+",NULL,"+(song.difficulty.easy ? song.difficulty.easy : "NULL")+","+(song.difficulty.normal ? song.difficulty.normal : "NULL")+","+(song.difficulty.hard ? song.difficulty.hard : "NULL")+","+(song.difficulty.oni ? song.difficulty.oni : "NULL")+","+(song.difficulty.ura ? song.difficulty.ura : "NULL")+",1,"+song.category+",'tja',0.0,NULL);";
}
//console.log("Reading: " + fpath);
const category_array = fs.readdirSync(fpath);
......@@ -79,4 +82,6 @@ for (var category_raw of category_array) {
}
}
console.log(JSON.stringify(all_songs, null, 2))
for (var song of all_songs) {
console.log(get_sql(song));
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment