Merge pull request #609 from TNG-dev/zkldi/issue-608

This commit is contained in:
zkldi
2022-07-23 15:20:53 +01:00
committed by GitHub
13 changed files with 12016 additions and 1647 deletions
-11
View File
@@ -1,11 +0,0 @@
export const BMS_TABLES = {
insane: "★",
overjoy: "★★",
normal: "☆",
normal2: "▽",
insane2: "▼",
stella: "st",
satellite: "sl",
dpNormal: "δ",
dpInsane: "★",
};
+21 -15
View File
@@ -1,7 +1,13 @@
import { BMS_TABLES } from "util/constants/bms-tables";
import { HumanFriendlyStrToGradeIndex, HumanFriendlyStrToLampIndex } from "util/str-to-num";
import { ValueGetterOrHybrid } from "util/ztable/search";
import { ChartDocument, Game, GamePTConfig, GetGamePTConfig, IDStrings } from "tachi-common";
import {
BMS_TABLE_ICONS,
ChartDocument,
Game,
GamePTConfig,
GetGamePTConfig,
IDStrings,
} from "tachi-common";
import { FolderDataset, PBDataset, ScoreDataset } from "types/tables";
import { Playtype } from "types/tachi";
@@ -145,21 +151,21 @@ function HandleBMSNonsense(
) {
const appendSearches: Record<string, ValueGetterOrHybrid<any>> = playtype === "7K"
? {
insane: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.insane),
overjoy: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.overjoy),
insane2: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.insane2),
normal: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.normal),
normal2: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.normal2),
st: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.stella),
sl: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.satellite),
satellite: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.satellite),
stella: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.stella),
insane: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.insane),
overjoy: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.overjoy),
insane2: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.insane2),
normal: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.normal),
normal2: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.normal2),
st: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.stella),
sl: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.satellite),
satellite: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.satellite),
stella: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.stella),
}
: {
insane: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.dpInsane),
normal: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.dpNormal),
sl: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.satellite),
satellite: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLES.satellite),
insane: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.dpInsane),
normal: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.dpNormal),
sl: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.satellite),
satellite: (x) => GetBMSTableVal(chartGetter(x), BMS_TABLE_ICONS.satellite),
};
Object.assign(searchFunctions, appendSearches);
+150
View File
@@ -0,0 +1,150 @@
import type { Playtypes } from "../types";
export interface BMSTableInfo {
prefix: string;
/**
* Used to generate tableIDs. This stops us from having characters like "◎" in tableIDs
* which would undoubtedly break some URLs.
*/
asciiPrefix: keyof typeof BMS_TABLE_ICONS;
name: string;
description: string;
playtype: Playtypes["bms"];
url: string;
}
export const BMS_TABLE_ICONS = {
insane: "★",
overjoy: "★★",
normal: "☆",
normal2: "▽",
insane2: "▼",
stella: "st",
satellite: "sl",
dpSatellite: "sl",
dpNormal: "δ",
dpInsane: "★",
scratch: "h◎",
ln: "◆",
stardust: "ξ",
starlight: "sr",
};
// I have no confidence in half of these links surviving.
// Eventually, some of these are going to disappear, and we'll have to find
// something else. probably.
export const BMS_TABLES: Array<BMSTableInfo> = [
{
name: "Insane",
playtype: "7K",
description: "The 7K GENOSIDE insane table.",
url: "http://www.ribbit.xyz/bms/tables/insane_body.json",
prefix: BMS_TABLE_ICONS.insane,
asciiPrefix: "insane",
},
{
name: "Normal",
playtype: "7K",
description: "The 7K GENOSIDE normal table.",
url: "http://www.ribbit.xyz/bms/tables/normal_body.json",
prefix: BMS_TABLE_ICONS.normal,
asciiPrefix: "normal",
},
{
name: "Stella",
playtype: "7K",
description: "The stella table, from Stellaverse.",
url: "https://stellabms.xyz/st/score.json",
prefix: BMS_TABLE_ICONS.stella,
asciiPrefix: "stella",
},
{
name: "Satellite",
playtype: "7K",
description: "The satellite table, from Stellaverse.",
url: "https://stellabms.xyz/sl/score.json",
prefix: BMS_TABLE_ICONS.satellite,
asciiPrefix: "satellite",
},
{
name: "Insane2",
playtype: "7K",
description: "A successor to the original insane table, but is generally less consistent.",
url: "http://rattoto10.jounin.jp/js/insane_data.json",
prefix: BMS_TABLE_ICONS.insane2,
asciiPrefix: "insane2",
},
{
name: "Normal2",
playtype: "7K",
description: "A successor to the original normal table.",
url: "http://rattoto10.jounin.jp/js/score.json",
prefix: BMS_TABLE_ICONS.normal2,
asciiPrefix: "normal2",
},
{
name: "Overjoy",
description: "The overjoy table. Level 1 is roughly equivalent to Insane 20.",
playtype: "7K",
url: "http://lr2.sakura.ne.jp/data/score.json",
prefix: BMS_TABLE_ICONS.overjoy,
asciiPrefix: "overjoy",
},
{
name: "DP Insane",
description: "The 14K Insane table.",
playtype: "14K",
prefix: BMS_TABLE_ICONS.dpInsane,
asciiPrefix: "dpInsane",
url: "http://dpbmsdelta.web.fc2.com/table/data/insane_data.json",
},
{
name: "DP Normal",
description: "The 14K Normal table, Sometimes called the delta table.",
playtype: "14K",
prefix: BMS_TABLE_ICONS.dpNormal,
asciiPrefix: "dpNormal",
url: "http://dpbmsdelta.web.fc2.com/table/data/dpdelta_data.json",
},
{
name: "DP Satellite",
description: "The 14K Satellite table.",
playtype: "14K",
prefix: BMS_TABLE_ICONS.dpSatellite,
asciiPrefix: "dpSatellite",
url: "https://stellabms.xyz/dp/score.json",
},
{
name: "Scratch 3rd",
description: "The 7K Sara 3 table.",
prefix: BMS_TABLE_ICONS.scratch,
asciiPrefix: "scratch",
playtype: "7K",
url: "http://minddnim.web.fc2.com/sara/3rd_hard/json/data.json",
},
{
name: "LN",
description: "The 7K LN table.",
prefix: BMS_TABLE_ICONS.ln,
asciiPrefix: "ln",
playtype: "7K",
url: "http://flowermaster.web.fc2.com/lrnanido/gla/score.json",
},
{
name: "Stardust",
prefix: BMS_TABLE_ICONS.stardust,
asciiPrefix: "stardust",
playtype: "7K",
url: "https://mqppppp.neocities.org/StardustData.json",
description: "The 7K Stardust table. This table covers ☆1 to ☆7.",
},
{
name: "Starlight",
prefix: BMS_TABLE_ICONS.starlight,
asciiPrefix: "starlight",
playtype: "7K",
url: "https://djkuroakari.github.io/data.json",
description: "The 7K Starlight table. This table covers ☆7 to ☆12.",
},
];
+1
View File
@@ -7,5 +7,6 @@ export * as StaticConfig from "./config/static-config";
export * from "./utils/util";
export * from "./webhooks";
export * from "./constants/game";
export * from "./constants/bms-tables";
export * from "./constants/permissions";
export * as Schemas from "./lib/schemas";
File diff suppressed because it is too large Load Diff
+640
View File
@@ -265,6 +265,48 @@
"title": "★9",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "★"
},
"folderID": "F769d0e12ce12897efe33a7a402be7260e0990d76629b4fe103ea9a11547a0865",
"game": "bms",
"inactive": false,
"playtype": "14K",
"searchTerms": [
"dpInsane"
],
"title": "DP Insane",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "δ"
},
"folderID": "Fe1d3fc21babda6bbf8f0421bbe641e914fe3a6fa7eb61708ea7e3dc44b29e58a",
"game": "bms",
"inactive": false,
"playtype": "14K",
"searchTerms": [
"dpNormal"
],
"title": "DP Normal",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "sl"
},
"folderID": "F4442d60db39ca8f8b37c960271e59b8039545272495185c899589db4b11e31f9",
"game": "bms",
"inactive": false,
"playtype": "14K",
"searchTerms": [
"dpSatellite"
],
"title": "DP Satellite",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
@@ -3667,6 +3709,310 @@
"title": "sl9",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "!",
"table": "sr"
}
}
},
"folderID": "F0a7b34236ba40e0cde7426a5c6919c0b06866efe6fe3508b6d43a916ed50f1a7",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight !"
],
"title": "sr!",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "?",
"table": "sr"
}
}
},
"folderID": "F45367aea9b30a92e1b861502b9a8f92edc0e6a6a1249649934e27c0e00a9ce3f",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight ?"
],
"title": "sr?",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "0",
"table": "sr"
}
}
},
"folderID": "F0f81b0a5f260520d372e2b66e429cfb213591c7bbad822530a7fa4ebf70465f0",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 0"
],
"title": "sr0",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "1",
"table": "sr"
}
}
},
"folderID": "F03ef9202532ef8356111903fa372f2bf7d8311326b2fe01609f488633ac646be",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 1"
],
"title": "sr1",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "10",
"table": "sr"
}
}
},
"folderID": "Fe9d2a0150cb7f5a3fec4b30fd187ccbc0be129ff82ad4007ee4ba8939f0545bb",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 10"
],
"title": "sr10",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "11",
"table": "sr"
}
}
},
"folderID": "F9e8b25af2445a573e4c9231e21492231a4e10bccd0bc2fff239b7aa84e72f06b",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 11"
],
"title": "sr11",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "12",
"table": "sr"
}
}
},
"folderID": "Fe3975b5c1010965519498224010171151bdaf8701d6eb8ce8cf2f25ab94cfb88",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 12"
],
"title": "sr12",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "13",
"table": "sr"
}
}
},
"folderID": "Fac25b0061bf21b3ef209c4a3fae962a1ea6b54f31fa558387b65e5553595b3ca",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 13"
],
"title": "sr13",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "2",
"table": "sr"
}
}
},
"folderID": "Fcc8476cf890d946e25d0b99547ddf4536801d7d52e8f484f4c52f90c2443910f",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 2"
],
"title": "sr2",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "3",
"table": "sr"
}
}
},
"folderID": "F7ba4da78d9aae7ac365953a23c7da661f9217da63d3211c23c2fce8814b05529",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 3"
],
"title": "sr3",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "4",
"table": "sr"
}
}
},
"folderID": "Fa85c796d58a0b7233c3bbd8eb729677910aed64c3fccf24f6fcad14ba36f0c6b",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 4"
],
"title": "sr4",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "5",
"table": "sr"
}
}
},
"folderID": "F2f09d60ddc4e6d2a153bf64d29e041927c184523a04428d098e554babcaa03f9",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 5"
],
"title": "sr5",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "6",
"table": "sr"
}
}
},
"folderID": "Fcd34366ee13b5339c690ff99f0ab001d6a50ea4ed357a4a5daee13a47d42934d",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 6"
],
"title": "sr6",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "7",
"table": "sr"
}
}
},
"folderID": "F028a1f6c76b514c135b3d76bad2a9f6f31e9f886c366b2cbe3a98277ee2a166a",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 7"
],
"title": "sr7",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "8",
"table": "sr"
}
}
},
"folderID": "Fca49c662ef26e51b802b3cd4a6d662ba065bd4dc7898816a5642987bd5c863a9",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 8"
],
"title": "sr8",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "9",
"table": "sr"
}
}
},
"folderID": "F68f2b05383f4efe41315053bf07102e0b8c3030e2061ae6c66913225a6401a27",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Starlight 9"
],
"title": "sr9",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
@@ -3914,6 +4260,34 @@
"title": "st9",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "ξ"
},
"folderID": "Fc307887b9958200a623b03fb2538f5b5ec8d2b951bf119edc6848ac255b335c4",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"stardust"
],
"title": "Stardust",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "sr"
},
"folderID": "F3aacc76df2f4bc79e4d0944c4e528223e0ff9a8dbda88c07e8377d9c465c7aa0",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"starlight"
],
"title": "Starlight",
"type": "charts"
},
{
"data": {
"data¬tableFolders¬table": "st"
@@ -3926,6 +4300,272 @@
"title": "Stella",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "?",
"table": "ξ"
}
}
},
"folderID": "Fc484371ac8c5cec8f1a9cf2deab6e07a971df167fa58371921511a4254e72a3a",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust ?"
],
"title": "ξ?",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "1",
"table": "ξ"
}
}
},
"folderID": "F5223d2972604af59298db03e4bd4551624c5687ab8aa9e46640c4815f50c68a4",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 1"
],
"title": "ξ1",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "10",
"table": "ξ"
}
}
},
"folderID": "F48f9f28b476ec0349fe808aab3b670cbb3603788274800a49ad536b16da026a7",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 10"
],
"title": "ξ10",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "11",
"table": "ξ"
}
}
},
"folderID": "F259ce798b7244a27c47d5a95edb6f587364fecccbe15b59b744ab13d845fe469",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 11"
],
"title": "ξ11",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "12",
"table": "ξ"
}
}
},
"folderID": "Fe377607434076c594e9be6c67c1c8f267e62830812bc77a10d27e1210af21449",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 12"
],
"title": "ξ12",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "13",
"table": "ξ"
}
}
},
"folderID": "F906c3c9295ba33d8ce31f465104d843ad92c7c772ce2226342d775d34101b493",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 13"
],
"title": "ξ13",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "2",
"table": "ξ"
}
}
},
"folderID": "Ffd24b409cdbe702194a0b9726123f52a288b4fbaa56fba65c8da83c332aeeba7",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 2"
],
"title": "ξ2",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "3",
"table": "ξ"
}
}
},
"folderID": "F72c4e379e5a73cfbd7b175cd95a707925ffea809ef5f9ceeef1c733f58e89f1d",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 3"
],
"title": "ξ3",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "4",
"table": "ξ"
}
}
},
"folderID": "Fdd8da30201d74d0d07bfbfe0ecbf3a56dcd50d9099b7532d82a1e9ef06ee2533",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 4"
],
"title": "ξ4",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "5",
"table": "ξ"
}
}
},
"folderID": "F764475cae613244fc167da358708fc3f9d47eb87fc59f92f6124961a4a45b35a",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 5"
],
"title": "ξ5",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "6",
"table": "ξ"
}
}
},
"folderID": "F737d0cd5c7e1b18ab85c56f9811119c315ad8f386a4babd59b1a95cf9f074004",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 6"
],
"title": "ξ6",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "7",
"table": "ξ"
}
}
},
"folderID": "Faf3a9c4250dfa3ff84d8a493a28ba07e59fea23d823ae440815b870775a43ac4",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 7"
],
"title": "ξ7",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "8",
"table": "ξ"
}
}
},
"folderID": "F90a61ff5baa0e827248f958bcc08d4fbdee064a3663e4c9e4b17ae74e3a0c7dc",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 8"
],
"title": "ξ8",
"type": "charts"
},
{
"data": {
"data¬tableFolders": {
"~elemMatch": {
"level": "9",
"table": "ξ"
}
}
},
"folderID": "Feeda79fa0accf291bf9de608f364d82df40f2db13a1837197eb865a310f5b16e",
"game": "bms",
"inactive": false,
"playtype": "7K",
"searchTerms": [
"Stardust 9"
],
"title": "ξ9",
"type": "charts"
},
{
"data": {
"level": "1",
+73 -5
View File
@@ -71,6 +71,20 @@
"tableID": "bms-14K-dpSatellite",
"title": "DP Satellite"
},
{
"default": false,
"description": "Meta tables that present existing tables as if they were single folders.",
"folders": [
"F769d0e12ce12897efe33a7a402be7260e0990d76629b4fe103ea9a11547a0865",
"Fe1d3fc21babda6bbf8f0421bbe641e914fe3a6fa7eb61708ea7e3dc44b29e58a",
"F4442d60db39ca8f8b37c960271e59b8039545272495185c899589db4b11e31f9"
],
"game": "bms",
"inactive": false,
"playtype": "14K",
"tableID": "bms-14K-meta",
"title": "Meta Table"
},
{
"default": true,
"description": "The 7K GENOSIDE insane table.",
@@ -195,7 +209,9 @@
"F592f40c2a6fe1d9e6576af59d2a767f2a8298656b492e8598ff44a89880f0015",
"F9147dcbf43425ad1f48b0c1e35536a667d97e7ac93bcff1656a0321694d1f406",
"Fffe3af5600bd7e3e5c78df671c11e8137070531ddee2d612f1c6ddc9c2944b0a",
"Fd8f69f38e6e033a41fa5a24d87060561ed5e1da4c6c81dc32bf24931a27359dc"
"Fd8f69f38e6e033a41fa5a24d87060561ed5e1da4c6c81dc32bf24931a27359dc",
"Fc307887b9958200a623b03fb2538f5b5ec8d2b951bf119edc6848ac255b335c4",
"F3aacc76df2f4bc79e4d0944c4e528223e0ff9a8dbda88c07e8377d9c465c7aa0"
],
"game": "bms",
"inactive": false,
@@ -296,11 +312,11 @@
"game": "bms",
"inactive": false,
"playtype": "7K",
"tableID": "bms-7K-sl",
"tableID": "bms-7K-satellite",
"title": "Satellite"
},
{
"default": false,
"default": true,
"description": "The 7K Sara 3 table.",
"folders": [
"F0b1c75d6731d9834c6f90509c7fcfd9b62b8cd97aef310e332455fd724eb840d",
@@ -325,9 +341,61 @@
"game": "bms",
"inactive": false,
"playtype": "7K",
"tableID": "bms-7K-scr",
"tableID": "bms-7K-scratch",
"title": "Scratch 3rd"
},
{
"default": false,
"description": "The 7K Stardust table. This table covers ☆1 to ☆7.",
"folders": [
"F5223d2972604af59298db03e4bd4551624c5687ab8aa9e46640c4815f50c68a4",
"Ffd24b409cdbe702194a0b9726123f52a288b4fbaa56fba65c8da83c332aeeba7",
"F72c4e379e5a73cfbd7b175cd95a707925ffea809ef5f9ceeef1c733f58e89f1d",
"Fdd8da30201d74d0d07bfbfe0ecbf3a56dcd50d9099b7532d82a1e9ef06ee2533",
"F764475cae613244fc167da358708fc3f9d47eb87fc59f92f6124961a4a45b35a",
"F737d0cd5c7e1b18ab85c56f9811119c315ad8f386a4babd59b1a95cf9f074004",
"Faf3a9c4250dfa3ff84d8a493a28ba07e59fea23d823ae440815b870775a43ac4",
"F90a61ff5baa0e827248f958bcc08d4fbdee064a3663e4c9e4b17ae74e3a0c7dc",
"Feeda79fa0accf291bf9de608f364d82df40f2db13a1837197eb865a310f5b16e",
"F48f9f28b476ec0349fe808aab3b670cbb3603788274800a49ad536b16da026a7",
"F259ce798b7244a27c47d5a95edb6f587364fecccbe15b59b744ab13d845fe469",
"Fe377607434076c594e9be6c67c1c8f267e62830812bc77a10d27e1210af21449",
"F906c3c9295ba33d8ce31f465104d843ad92c7c772ce2226342d775d34101b493",
"Fc484371ac8c5cec8f1a9cf2deab6e07a971df167fa58371921511a4254e72a3a"
],
"game": "bms",
"inactive": false,
"playtype": "7K",
"tableID": "bms-7K-stardust",
"title": "Stardust"
},
{
"default": false,
"description": "The 7K Starlight table. This table covers ☆7 to ☆12.",
"folders": [
"F0f81b0a5f260520d372e2b66e429cfb213591c7bbad822530a7fa4ebf70465f0",
"F03ef9202532ef8356111903fa372f2bf7d8311326b2fe01609f488633ac646be",
"Fcc8476cf890d946e25d0b99547ddf4536801d7d52e8f484f4c52f90c2443910f",
"F7ba4da78d9aae7ac365953a23c7da661f9217da63d3211c23c2fce8814b05529",
"Fa85c796d58a0b7233c3bbd8eb729677910aed64c3fccf24f6fcad14ba36f0c6b",
"F2f09d60ddc4e6d2a153bf64d29e041927c184523a04428d098e554babcaa03f9",
"Fcd34366ee13b5339c690ff99f0ab001d6a50ea4ed357a4a5daee13a47d42934d",
"F028a1f6c76b514c135b3d76bad2a9f6f31e9f886c366b2cbe3a98277ee2a166a",
"Fca49c662ef26e51b802b3cd4a6d662ba065bd4dc7898816a5642987bd5c863a9",
"F68f2b05383f4efe41315053bf07102e0b8c3030e2061ae6c66913225a6401a27",
"Fe9d2a0150cb7f5a3fec4b30fd187ccbc0be129ff82ad4007ee4ba8939f0545bb",
"F9e8b25af2445a573e4c9231e21492231a4e10bccd0bc2fff239b7aa84e72f06b",
"Fe3975b5c1010965519498224010171151bdaf8701d6eb8ce8cf2f25ab94cfb88",
"Fac25b0061bf21b3ef209c4a3fae962a1ea6b54f31fa558387b65e5553595b3ca",
"F45367aea9b30a92e1b861502b9a8f92edc0e6a6a1249649934e27c0e00a9ce3f",
"F0a7b34236ba40e0cde7426a5c6919c0b06866efe6fe3508b6d43a916ed50f1a7"
],
"game": "bms",
"inactive": false,
"playtype": "7K",
"tableID": "bms-7K-starlight",
"title": "Starlight"
},
{
"default": false,
"description": "The stella table, from Stellaverse.",
@@ -349,7 +417,7 @@
"game": "bms",
"inactive": false,
"playtype": "7K",
"tableID": "bms-7K-st",
"tableID": "bms-7K-stella",
"title": "Stella"
},
{
+2
View File
@@ -1,3 +1,5 @@
throw new Error(`This script doesn't work at the moment. Use mongoexp.sh.`);
const monk = require("monk");
const { Command } = require("commander");
const { StaticConfig } = require("tachi-common");
+1 -1
View File
@@ -4,7 +4,7 @@
# folder.
# Useful for backporting updates, or something.
set -euo pipefail
set -eo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
-13
View File
@@ -1,13 +0,0 @@
export const BMS_TABLES = {
insane: "★",
overjoy: "★★",
normal: "☆",
normal2: "▽",
insane2: "▼",
stella: "st",
satellite: "sl",
dpNormal: "δ",
dpInsane: "★",
scratch: "h◎",
ln: "◆",
};
+49 -117
View File
@@ -1,113 +1,11 @@
/* eslint-disable no-await-in-loop */
import db from "external/mongo/db";
import { BMS_TABLES } from "lib/constants/bms-tables";
import CreateLogCtx from "lib/logger/logger";
import fetch from "node-fetch";
import { BMS_TABLES } from "tachi-common";
import { CreateFolderID, InitaliseFolderChartLookup } from "utils/folder";
import { FormatBMSTables } from "utils/misc";
import type { ChartDocument } from "tachi-common";
// I have no confidence in half of these links surviving.
// Eventually, some of these are going to disappear, and we'll have to find
// something else. probably.
const registeredTables: Array<BMSTablesDataset> = [
{
name: "Insane",
humanisedPrefix: "insane",
playtype: "7K",
prefix: BMS_TABLES.insane,
description: "The 7K GENOSIDE insane table.",
url: "http://www.ribbit.xyz/bms/tables/insane_body.json",
},
{
name: "Normal",
humanisedPrefix: "normal",
playtype: "7K",
prefix: BMS_TABLES.normal,
description: "The 7K GENOSIDE normal table.",
url: "http://www.ribbit.xyz/bms/tables/normal_body.json",
},
{
name: "Stella",
humanisedPrefix: "st",
playtype: "7K",
prefix: BMS_TABLES.stella,
description: "The stella table, from Stellaverse.",
url: "https://stellabms.xyz/st/score.json",
},
{
name: "Satellite",
humanisedPrefix: "sl",
playtype: "7K",
prefix: BMS_TABLES.satellite,
description: "The satellite table, from Stellaverse.",
url: "https://stellabms.xyz/sl/score.json",
},
{
name: "Insane2",
humanisedPrefix: "insane2",
playtype: "7K",
prefix: BMS_TABLES.insane2,
description: "A successor to the original insane table, but is generally less consistent.",
url: "http://rattoto10.jounin.jp/js/insane_data.json",
},
{
name: "Normal2",
humanisedPrefix: "normal2",
playtype: "7K",
prefix: BMS_TABLES.normal2,
description: "A successor to the original normal table.",
url: "http://rattoto10.jounin.jp/js/score.json",
},
{
name: "Overjoy",
description: "The overjoy table. Level 1 is roughly equivalent to Insane 20.",
humanisedPrefix: "overjoy",
playtype: "7K",
prefix: BMS_TABLES.overjoy,
url: "http://lr2.sakura.ne.jp/data/score.json",
},
{
name: "DP Insane",
description: "The 14K Insane table.",
humanisedPrefix: "dpInsane",
prefix: BMS_TABLES.dpInsane,
playtype: "14K",
url: "http://dpbmsdelta.web.fc2.com/table/data/insane_data.json",
},
{
name: "DP Normal",
description: "The 14K Normal table, Sometimes called the delta table.",
humanisedPrefix: "dpNormal",
prefix: BMS_TABLES.dpNormal,
playtype: "14K",
url: "http://dpbmsdelta.web.fc2.com/table/data/dpdelta_data.json",
},
{
name: "DP Satellite",
description: "The 14K Satellite table.",
humanisedPrefix: "dpSatellite",
prefix: BMS_TABLES.satellite,
playtype: "14K",
url: "https://stellabms.xyz/dp/score.json",
},
{
name: "Scratch 3rd",
description: "The 7K Sara 3 table.",
humanisedPrefix: "scr",
prefix: BMS_TABLES.scratch,
playtype: "7K",
url: "http://minddnim.web.fc2.com/sara/3rd_hard/json/data.json",
},
{
name: "LN",
description: "The 7K LN table.",
humanisedPrefix: "ln",
prefix: BMS_TABLES.ln,
playtype: "7K",
url: "http://flowermaster.web.fc2.com/lrnanido/gla/score.json",
},
];
import type { BMSTableInfo, ChartDocument } from "tachi-common";
// this seems to be all we care about
interface TableJSONDoc {
@@ -169,15 +67,6 @@ async function ImportTableLevels(tableJSON: Array<TableJSONDoc>, prefix: string)
logger.info(`${success} Success | ${failures} Failures | ${total} Total.`);
}
export interface BMSTablesDataset {
url: string;
name: string;
description: string;
humanisedPrefix: string;
prefix: string;
playtype: "7K" | "14K";
}
interface BMSTableChart {
title: string;
artist: string;
@@ -190,7 +79,7 @@ interface BMSTableChart {
const RETRY_COUNT = 3;
export async function UpdateTable(table: BMSTablesDataset) {
export async function UpdateTable(table: BMSTableInfo) {
const res = await fetch(table.url);
const statusCode = res.status;
@@ -227,7 +116,7 @@ export async function UpdateTable(table: BMSTablesDataset) {
}
}
const tableID = `bms-${table.playtype}-${table.humanisedPrefix}`;
const tableID = `bms-${table.playtype}-${table.asciiPrefix}`;
const folderIDs = [];
const levels = [...new Set(tableJSON.map((e) => e.level))];
@@ -267,7 +156,7 @@ export async function UpdateTable(table: BMSTablesDataset) {
searchTerms: [`${table.name} ${level}`],
});
logger.info(`Inserted new table ${table.prefix}${level}.`);
logger.info(`Inserted new folder ${table.prefix}${level}.`);
}
await db.tables.update(
@@ -282,6 +171,9 @@ export async function UpdateTable(table: BMSTablesDataset) {
description: table.description,
inactive: false,
},
$setOnInsert: {
default: false,
},
},
{
upsert: true,
@@ -290,13 +182,53 @@ export async function UpdateTable(table: BMSTablesDataset) {
logger.info(`Bumped table ${table.name}.`);
logger.info(`Checking meta-folder...`);
const metaQuery = {
"data¬tableFolders¬table": table.prefix,
};
const folderID = CreateFolderID(metaQuery, "bms", table.playtype);
folderIDs.push(folderID);
const exists = await db.folders.findOne({
folderID,
});
if (!exists) {
await db.folders.insert({
title: `${table.name}`,
inactive: false,
folderID,
game: "bms",
playtype: table.playtype,
type: "charts",
data: metaQuery,
searchTerms: [table.asciiPrefix],
});
await db.tables.update(
{
tableID: `bms-${table.playtype}-meta`,
},
{
$push: {
folders: folderID,
},
}
);
logger.info(`Inserted meta folder for ${table.name}.`);
}
logger.info(`Bumping levels...`);
await ImportTableLevels(tableJSON, table.prefix);
logger.info(`Levels bumped.`);
}
export async function SyncBMSTables() {
for (const table of registeredTables) {
for (const table of BMS_TABLES) {
// eslint-disable-next-line no-await-in-loop
await UpdateTable(table);
}
+8 -19
View File
@@ -1,68 +1,57 @@
/* eslint-disable no-await-in-loop */
import fetch from "node-fetch";
import { BMS_TABLE_ICONS } from "tachi-common";
import type { BMSTablesDataset, BMSTableChart } from "./types";
export const BMS_TABLES = {
insane: "★",
overjoy: "★★",
normal: "☆",
normal2: "▽",
insane2: "▼",
stella: "st",
satellite: "sl",
dpNormal: "δ",
dpInsane: "★",
};
const registeredTables: Array<BMSTablesDataset> = [
{
name: "Insane",
playtype: "7K",
description: "The 7K GENOSIDE insane table.",
url: "http://www.ribbit.xyz/bms/tables/insane_body.json",
prefix: BMS_TABLES.insane,
prefix: BMS_TABLE_ICONS.insane,
},
{
name: "Normal",
playtype: "7K",
description: "The 7K GENOSIDE normal table.",
url: "http://www.ribbit.xyz/bms/tables/normal_body.json",
prefix: BMS_TABLES.normal,
prefix: BMS_TABLE_ICONS.normal,
},
{
name: "Stella",
playtype: "7K",
description: "The stella table, from Stellaverse.",
url: "https://stellabms.xyz/st/score.json",
prefix: BMS_TABLES.stella,
prefix: BMS_TABLE_ICONS.stella,
},
{
name: "Satellite",
playtype: "7K",
description: "The satellite table, from Stellaverse.",
url: "https://stellabms.xyz/sl/score.json",
prefix: BMS_TABLES.satellite,
prefix: BMS_TABLE_ICONS.satellite,
},
{
name: "Insane2",
playtype: "7K",
description: "A successor to the original insane table, but is generally less consistent.",
url: "http://rattoto10.jounin.jp/js/insane_data.json",
prefix: BMS_TABLES.insane2,
prefix: BMS_TABLE_ICONS.insane2,
},
{
name: "Normal2",
playtype: "7K",
description: "A successor to the original normal table.",
url: "http://rattoto10.jounin.jp/js/score.json",
prefix: BMS_TABLES.normal2,
prefix: BMS_TABLE_ICONS.normal2,
},
{
name: "Overjoy",
description: "The overjoy table. Level 1 is roughly equivalent to Insane 20.",
playtype: "7K",
url: "http://lr2.sakura.ne.jp/data/score.json",
prefix: BMS_TABLES.overjoy,
prefix: BMS_TABLE_ICONS.overjoy,
},
// {
+17 -8
View File
@@ -1,19 +1,28 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"baseUrl": "src",
"outDir": "./js",
"lib": [
"ES2019"
],
"declaration": true,
"strict": true,
"allowJs": false,
"esModuleInterop": true,
"sourceMap": true,
"outDir": "./js",
"typeRoots": [
"@types",
"node_modules/@types",
],
"paths": {
"tachi-common": [
"../../common/src"
],
"tachi-common/*": [
"../../common/src/*"
]
}
},
"ts-node": {
"require": [
"tsconfig-paths/register"
]
},
"include": [
"src/**/*.ts",