Skip to content

Commit

Permalink
import all new data
Browse files Browse the repository at this point in the history
  • Loading branch information
noahm committed Apr 12, 2024
1 parent bb0582a commit 085d0a2
Show file tree
Hide file tree
Showing 2 changed files with 6,678 additions and 189 deletions.
19 changes: 18 additions & 1 deletion scripts/import-sdvx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ async function main() {
console.log(`getting list of song jackets from ${JACKETS_PATH}`);
const availableJackets = new Set(await fs.readdir(JACKETS_PATH));

/** @type {GameData} */
const data = {
meta: {
menuParent: "more",
styles: ["single"],
difficulties: [
{ key: "novice", color: "#800080" },
Expand All @@ -62,6 +64,7 @@ async function main() {
{ key: "exceed", color: "#0047AB" },
],
flags: typedKeys(SDVX_UNLOCK_IDS),
lastUpdated: Date.now(),
},
defaults: {
style: "single",
Expand Down Expand Up @@ -91,6 +94,10 @@ async function main() {
heavenly: "Heavenly",
vivid: "Vivid",
exceed: "Exceed",
omegaDimension: "Blaster Gate/Omega Dimension",
hexadiver: "Hexadiver",
otherEvents: "Time-limited & Other Events",
jpOnly: "J-Region Exclusive",
$abbr: {
novice: "NOV",
advanced: "ADV",
Expand Down Expand Up @@ -187,6 +194,15 @@ function determineChartJacket(chartType, song, availableJackets) {
return `sdvx/${jacketName}`;
}

/**
*
* @param {string} input in the format YYYYMMDD
* @returns date string with dash separators YYYY-MM-DD
*/
function reformatDate(input) {
return `${input.slice(0, 4)}-${input.slice(4, 6)}-${input.slice(-2)}`;
}

/**
*
* @param {*} song
Expand Down Expand Up @@ -242,7 +258,8 @@ function buildSong(song, availableJackets) {
const ret = {
name: info.title_name[0],
search_hint: info.ascii[0],
date_added: info.distribution_date[0],
date_added: reformatDate(info.distribution_date[0]._),
saHash: song.$.id,
artist: info.artist_name[0],
jacket: usesSharedJacket
? `sdvx/jk_${("000" + parseInt(song.$.id)).slice(-4)}_1_s.png`
Expand Down
Loading

0 comments on commit 085d0a2

Please sign in to comment.