Read tricoro info from versions.json

This commit is contained in:
zkldi
2021-09-07 10:44:38 +01:00
parent bdaf8107fd
commit fa958052bc
4 changed files with 45 additions and 7 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
"redis": "3.1.2",
"rimraf": "3.0.2",
"safe-json-stringify": "1.2.0",
"tachi-common": "0.2.4",
"tachi-common": "0.2.5",
"typescript": "4.3.4",
"winston": "3.3.3"
},
+4 -4
View File
@@ -54,7 +54,7 @@ specifiers:
rimraf: 3.0.2
safe-json-stringify: 1.2.0
supertest: 6.1.3
tachi-common: 0.2.4
tachi-common: 0.2.5
tap: 15.0.9
ts-node: 10.0.0
tsconfig-paths: 3.10.1
@@ -88,7 +88,7 @@ dependencies:
redis: 3.1.2
rimraf: 3.0.2
safe-json-stringify: 1.2.0
tachi-common: 0.2.4_ts-node@10.0.0+typescript@4.3.4
tachi-common: 0.2.5_ts-node@10.0.0+typescript@4.3.4
typescript: 4.3.4
winston: 3.3.3
@@ -3681,8 +3681,8 @@ packages:
strip-ansi: 6.0.0
dev: true
/tachi-common/0.2.4_ts-node@10.0.0+typescript@4.3.4:
resolution: {integrity: sha512-5Q6c0qGhQyPKKiCg+BvuYbt9k5q/B1c3aBNR3KaX+aEKSQ8ZbuYTcKPKnQlDccjDfcGNj2OAmELx3oHz4UJdGA==}
/tachi-common/0.2.5_ts-node@10.0.0+typescript@4.3.4:
resolution: {integrity: sha512-ldBQpc9LMNoeB5t7EI5MtmqawhHeCzFbGjtGmrdpPlKyUol838FzOSaBFNWPKCOadCT2m5wbzif1L/yt8SeE4A==}
dependencies:
monk: 7.3.4
tap: 15.0.9_ts-node@10.0.0+typescript@4.3.4
@@ -0,0 +1,21 @@
import db from "external/mongo/db";
import { Random20Hex } from "utils/misc";
(async () => {
const docs = await db.charts.iidx.find({ version: "inf" }, { projectID: true });
for (const doc of docs) {
await db.charts.iidx.update(
{
_id: doc._id,
},
{
$set: {
chartID: Random20Hex(),
},
}
);
}
console.log("done");
})();
@@ -19,7 +19,7 @@ const DIFF_MAP = {
X: "LEGGENDARIA",
} as any;
function ConvertVersion(c: string) {
function ConvertVersion(c: string): any {
if (c.startsWith("AC")) {
return c.split("AC")[1];
} else if (c.startsWith("OM")) {
@@ -54,6 +54,12 @@ function ConvertVersion(c: string) {
"OM26",
"AC27",
"AC26",
"AC25",
"AC24",
"AC23",
"AC22",
"AC21",
"AC20",
"INF",
"CS16",
"CS15",
@@ -75,7 +81,18 @@ function ConvertVersion(c: string) {
.map(ConvertVersion);
if (!relevantVersions.includes("27-omni") && !relevantVersions.includes("inf")) {
logger.warn(`Song ${song.title} (${playtype} ${difficulty}) has no relevant versions.`);
if (relevantVersions.includes("26-omni")) {
logger.info(
`Song ${song.title} (${playtype} ${difficulty}) was a very recent removal. Consider deprimarifying it.(had ${relevantVersions})`,
{ keys: Object.keys(data).filter((e) => data[e] === "1") }
);
} else {
logger.verbose(
`Song ${song.title} (${playtype} ${difficulty}) has no relevant versions. (had ${relevantVersions})`,
{ keys: Object.keys(data).filter((e) => data[e] === "1") }
);
}
continue;
}