rename all instances of ktchi to tachi and change how config works

This commit is contained in:
zkldi
2021-06-08 14:21:09 +01:00
parent 2f943115c0
commit 9602877baf
49 changed files with 317 additions and 254 deletions
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { TierlistParent, Game } from "tachi-common";
import { gameHuman, validPlaytypes } from "tachi-common/js/config";
import db from "../../src/db/db";
import db from "../../src/external/mongo/db";
import MigrateRecords from "./migrate";
function ConvertFn(c: any): TierlistParent {
+3 -3
View File
@@ -39,7 +39,7 @@ async function MergeIDs() {
}
// eslint-disable-next-line no-await-in-loop
const ktchiChart = await FindChartWithPTDFVersion(
const tachiChart = await FindChartWithPTDFVersion(
"iidx",
song.id,
playtype,
@@ -47,7 +47,7 @@ async function MergeIDs() {
version
);
if (!ktchiChart) {
if (!tachiChart) {
logger.error(
`Could not find chart ${songTitle} ${playtype} ${difficulty} ${version}.`
);
@@ -59,7 +59,7 @@ async function MergeIDs() {
db.charts.iidx as unknown as ICollection<ChartDocument<"iidx:SP" | "iidx:DP">>
).update(
{
_id: ktchiChart._id,
_id: tachiChart._id,
},
{
$set: {
+9 -9
View File
@@ -60,24 +60,24 @@ async function UpdatePoyashiData() {
const [playtype, diff] = res;
const ktchiSong = await FindSongOnTitle("iidx", d.title);
const tachiSong = await FindSongOnTitle("iidx", d.title);
if (!ktchiSong) {
if (!tachiSong) {
logger.warn(`Cannot find song ${d.title}?`);
continue;
}
const ktchiChart = (await FindChartWithPTDFVersion(
const tachiChart = (await FindChartWithPTDFVersion(
"iidx",
ktchiSong.id,
tachiSong.id,
playtype as "SP" | "DP",
diff as Difficulties["iidx:DP" | "iidx:SP"],
"28"
)) as ChartDocument<"iidx:SP" | "iidx:DP">;
if (!ktchiChart) {
if (!tachiChart) {
logger.warn(
`Cannot find chart ${ktchiSong.title} (${ktchiSong.id}) ${playtype}, ${diff}?`
`Cannot find chart ${tachiSong.title} (${tachiSong.id}) ${playtype}, ${diff}?`
);
continue;
}
@@ -86,21 +86,21 @@ async function UpdatePoyashiData() {
if (kavg < 0) {
logger.warn(
`${ktchiSong.title} (${playtype} ${diff}). Invalid kavg ${d.avg}, Skipping.`
`${tachiSong.title} (${playtype} ${diff}). Invalid kavg ${d.avg}, Skipping.`
);
continue;
}
const kesd = ESDCore.CalculateESD(
config.judgementWindows.iidx.SP,
kavg / (ktchiChart.data.notecount * 2)
kavg / (tachiChart.data.notecount * 2)
);
realData.push({
coef: d.coef === -1 ? null : d.coef,
kavg: Number(d.avg),
wr: Number(d.wr),
chartID: ktchiChart.chartID,
chartID: tachiChart.chartID,
kesd,
});
}