Merge pull request #137 from zkldi:zkldi/issue101

zkldi/issue101
This commit is contained in:
zkldi
2021-05-26 11:17:00 +01:00
committed by GitHub
+5 -5
View File
@@ -87,8 +87,10 @@ export function FindChartOnInGameID(
playtype: Playtypes[Game],
difficulty: Difficulties[IDStrings]
) {
// @todo #101 throw an error if this is called with a game that doesn't
// support InGameID.
if (game === "bms" || game === "usc") {
throw new Error(`Cannot call FindChartOnInGameID for game ${game}.`);
}
return db.charts[game].findOne({
"data.inGameID": inGameID,
playtype,
@@ -124,8 +126,6 @@ export function FindIIDXChartOnInGameIDVersion(
difficulty: Difficulties[IDStrings],
version: string
) {
// @todo #101 throw an error if this is called with a game that doesn't
// support InGameID.
return db.charts.iidx.findOne({
"data.inGameID": inGameID,
"flags.2dxtra": false,
@@ -170,7 +170,7 @@ export function FindIIDXChartWith2DXtraHash(hash: string) {
*/
export function FindSDVXChartOnInGameID(
inGameID: number,
difficulty: "NOV" | "ADV" | "EXH" | "MXM" | "ANY_INF"
difficulty: Difficulties["sdvx:Single"] | "ANY_INF"
) {
const diffQuery =
difficulty === "ANY_INF"