diff --git a/src/getGJLevels21.ts b/src/getGJLevels21.ts index 296bee3..6f96f86 100644 --- a/src/getGJLevels21.ts +++ b/src/getGJLevels21.ts @@ -18,6 +18,15 @@ module.exports = (app, db) : void => { if (req.body.twoPlayer != '0') searchQuery.twoPlayer = true; if (req.body.star) searchQuery.stars = {$gt: 0}; if (req.body.original != '0') searchQuery.original = true; + if (req.body.noStar) searchQuery.stars = 0; + + if (req.body.song) { + if (Number(req.body.song) <= 50) { // lets assume a limit of 50 official songs + searchQuery.audio_track = Number(req.body.song); // official song + } else { + searchQuery.song_id = Number(req.body.song); // newgrounds/custom songs + } + } if (req.body.diff != '-') { // if the client requests -1, -2 or -3 then it cant request any other difficulties