add a bit of new variables and fixes
This commit is contained in:
parent
2e0abf2878
commit
0233b8fecb
|
@ -33,8 +33,6 @@ module.exports = (app) : void => {
|
|||
extraData += `,${level.password},${0 /* featured id */}`;
|
||||
response += `${hashes.hashSolo2(extraData)}#${extraData}`;
|
||||
|
||||
console.log(response);
|
||||
|
||||
res.status(200).send(response);
|
||||
});
|
||||
};
|
|
@ -80,6 +80,10 @@ module.exports = (app) : void => {
|
|||
case 4: // recent
|
||||
levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0);
|
||||
break;
|
||||
case 6: // featured
|
||||
levels.filter(l => l.featured);
|
||||
levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0);
|
||||
break;
|
||||
case 7: // ~ M a G i C ~
|
||||
levels.filter(l => {
|
||||
l.objects || 0 > 1000;
|
||||
|
@ -95,6 +99,10 @@ module.exports = (app) : void => {
|
|||
case 12: // TODO: followed
|
||||
case 13: // TODO: friends
|
||||
levels.filter(() => false);
|
||||
break;
|
||||
case 16: // epic
|
||||
levels.filter(l => l.epic);
|
||||
levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0);
|
||||
}
|
||||
|
||||
let offset = Math.max(Number(req.body.page) * levelsPerPage - 1, 0);
|
||||
|
@ -104,7 +112,7 @@ module.exports = (app) : void => {
|
|||
|
||||
let results = foundLevels
|
||||
.map(l =>
|
||||
`1:${l.id}:2:${l.name}:5:0:6:16:8:10:9:${l.difficulty}:10:${l.downloads}:12:1:13:21:14:${l.likes}:17:0:43:0:25:${Number(l.auto)}:18:${l.stars}:19:0:42:0:45:10:3:${l.description}:15:1:30:0:31:0:37:0:38:0:39:0:46:1:47:2:40:0:35:0`
|
||||
`1:${l.id}:2:${l.name}:5:${l.version}:6:${l.userID}:8:10:9:${l.difficulty}:10:${l.downloads}:12:${l.audioTrack}:13:${l.gameVersion}:14:${l.likes}:17:${Number(l.difficulty >= 60)}:43:${Math.max(l.difficulty - 60, 0)}:25:${Number(l.auto)}:18:${l.stars}:19:${Number(l.featured)}:42:${Number(l.epic)}:45:${l.objects}:3:${l.description}:15:${l.length}:30:${l.original}:31:0:37:${l.coins}:38:${Number(l.ratedCoins)}:39:${l.requestedStars}:46:1:47:2:40:${Number(l.hasLDM)}:35:${l.songID}`
|
||||
)
|
||||
.join('|');
|
||||
|
||||
|
|
Loading…
Reference in New Issue