song and nostar searching
This commit is contained in:
parent
783c373d41
commit
e52f31882f
|
@ -18,6 +18,15 @@ module.exports = (app, db) : void => {
|
||||||
if (req.body.twoPlayer != '0') searchQuery.twoPlayer = true;
|
if (req.body.twoPlayer != '0') searchQuery.twoPlayer = true;
|
||||||
if (req.body.star) searchQuery.stars = {$gt: 0};
|
if (req.body.star) searchQuery.stars = {$gt: 0};
|
||||||
if (req.body.original != '0') searchQuery.original = true;
|
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 (req.body.diff != '-') {
|
||||||
// if the client requests -1, -2 or -3 then it cant request any other difficulties
|
// if the client requests -1, -2 or -3 then it cant request any other difficulties
|
||||||
|
|
Loading…
Reference in New Issue