mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 05:57:04 +03:00
added ability to query mysql database
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = function getViewsForUser(req, res) {
|
||||
userID = getHash(userID);
|
||||
|
||||
try {
|
||||
let row = db.prepare("SELECT SUM(views) as viewCount FROM sponsorTimes WHERE userID = ?").get(userID);
|
||||
let row = db.prepare('get', "SELECT SUM(views) as viewCount FROM sponsorTimes WHERE userID = ?", [userID]);
|
||||
|
||||
//increase the view count by one
|
||||
if (row.viewCount != null) {
|
||||
|
||||
Reference in New Issue
Block a user