Raised stats limit to 100.

This commit is contained in:
Ajay Ramachandran 2019-08-19 20:42:25 -04:00
parent db1a3a4062
commit 69258587bc

View file

@ -374,7 +374,7 @@ app.get('/api/getTopUsers', function (req, res) {
let totalSubmissions = []; let totalSubmissions = [];
let minutesSaved = []; let minutesSaved = [];
db.prepare("SELECT sponsorTimes.userID as userID, COUNT(*) as totalSubmissions, SUM(views) as viewCount, SUM((sponsorTimes.endTime - sponsorTimes.startTime) / 60 * sponsorTimes.views) as minutesSaved, userNames.userName as userName FROM sponsorTimes LEFT JOIN userNames ON sponsorTimes.userID=userNames.userID WHERE sponsorTimes.votes > -1 GROUP BY sponsorTimes.userID ORDER BY " + sortBy + " DESC LIMIT 50").all(function(err, rows) { db.prepare("SELECT sponsorTimes.userID as userID, COUNT(*) as totalSubmissions, SUM(views) as viewCount, SUM((sponsorTimes.endTime - sponsorTimes.startTime) / 60 * sponsorTimes.views) as minutesSaved, userNames.userName as userName FROM sponsorTimes LEFT JOIN userNames ON sponsorTimes.userID=userNames.userID WHERE sponsorTimes.votes > -1 GROUP BY sponsorTimes.userID ORDER BY " + sortBy + " DESC LIMIT 100").all(function(err, rows) {
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
if (rows[i].userName != null) { if (rows[i].userName != null) {
userNames[i] = rows[i].userName; userNames[i] = rows[i].userName;