Removed shadow hidden submissions from stats.

This commit is contained in:
Ajay Ramachandran 2019-11-15 16:16:42 -05:00
parent 17f7e618ec
commit aae0a6f9d4

View file

@ -625,7 +625,7 @@ app.get('/api/getTopUsers', function (req, res) {
let totalSubmissions = [];
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 100").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 AND sponsorTimes.shadowHidden != 1 GROUP BY sponsorTimes.userID ORDER BY " + sortBy + " DESC LIMIT 100").all(function(err, rows) {
for (let i = 0; i < rows.length; i++) {
if (rows[i].userName != null) {
userNames[i] = rows[i].userName;