feat: release version 1.0.8
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
|
||||
const sourceOrigin = process.argv[2] ?? 'https://dreams.wf-calc.net';
|
||||
@@ -11,11 +12,20 @@ const scoreCalibrationByKey = new Map(scoreCalibrations.charts.map((row) => [
|
||||
`${row.songId}::${row.difficulty}`,
|
||||
row
|
||||
]));
|
||||
const musicMaster = JSON.parse(await readFile(path.resolve('data/raw/holodoridb/kor/Music.json'), 'utf8'));
|
||||
function readHolodoriDbSource(locale, filename) {
|
||||
const repositoryPath = path.resolve(`data/raw/holodoridb/${locale}`);
|
||||
return JSON.parse(execFileSync('git', [
|
||||
'-c', `safe.directory=${repositoryPath.replaceAll('\\', '/')}`,
|
||||
'-C', repositoryPath,
|
||||
'show', `origin/main:${filename}`
|
||||
], { encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 }));
|
||||
}
|
||||
|
||||
const musicMaster = readHolodoriDbSource('kor', 'Music.json');
|
||||
const musicById = new Map(musicMaster.map((row) => [row.data?.id ?? row.id, row.data ?? row]));
|
||||
const englishMusicText = JSON.parse(await readFile(path.resolve('data/raw/holodoridb/eng/LangMusic_Eng.json'), 'utf8'));
|
||||
const englishMusicText = readHolodoriDbSource('eng', 'LangMusic_Eng.json');
|
||||
const englishTextById = new Map(englishMusicText.map((row) => [row.data?.id ?? row.id, row.data?.text ?? row.text]));
|
||||
const musicDifficultyMaster = JSON.parse(await readFile(path.resolve('data/raw/holodoridb/kor/MusicDifficulty.json'), 'utf8'));
|
||||
const musicDifficultyMaster = readHolodoriDbSource('kor', 'MusicDifficulty.json');
|
||||
const difficultyLevelByKey = new Map(musicDifficultyMaster.map((row) => {
|
||||
const data = row.data ?? row;
|
||||
return [`${data.musicId}::${data.difficultyType.split('_').at(-1)?.toLowerCase()}`, data.difficultyLevel];
|
||||
@@ -224,6 +234,7 @@ async function worker() {
|
||||
const sourceEntry = catalogByKey.get(`${item.songId}::${item.difficulty}`);
|
||||
const music = musicById.get(item.songId);
|
||||
const singerOverride = singerMetadataOverrides[item.songId];
|
||||
const releaseTime = Number(music?.startTime);
|
||||
const notes = flattenEvents(chartData);
|
||||
const measuredCalibration = scoreCalibrationByKey.get(`${item.songId}::${item.difficulty.toLowerCase()}`);
|
||||
const output = {
|
||||
@@ -260,6 +271,7 @@ async function worker() {
|
||||
totalNotes: notes.length,
|
||||
singerType: output.singerType,
|
||||
singerCharacterIds: output.singerCharacterIds,
|
||||
releaseTime: Number.isFinite(releaseTime) ? releaseTime : null,
|
||||
path: `/data/charts/${fileName}`
|
||||
});
|
||||
completed += 1;
|
||||
@@ -273,7 +285,7 @@ await Promise.all(Array.from({ length: 6 }, () => worker()));
|
||||
normalizedCharts.sort((left, right) => left.songId.localeCompare(right.songId) || left.difficulty.localeCompare(right.difficulty));
|
||||
await writeFile(catalogPath, `${JSON.stringify({
|
||||
schemaVersion: 1,
|
||||
source: sourceOrigin,
|
||||
source: `${sourceOrigin}; hololive Dreams CDN via https://github.com/HolodoriDB/holodori-asset-tools`,
|
||||
charts: normalizedCharts
|
||||
}, null, 2)}\n`, 'utf8');
|
||||
console.log(`${normalizedCharts.length}개 정확 채보를 저장했습니다.`);
|
||||
|
||||
Reference in New Issue
Block a user