mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-27 01:48:33 +03:00
Add Limit 1 when check user as vip
This commit is contained in:
@@ -281,7 +281,7 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise<Re
|
||||
const hashedIP: HashedIP = getHash((ip + config.globalSalt) as IPAddress);
|
||||
|
||||
//check if this user is on the vip list
|
||||
const isVIP = (await db.prepare("get", `SELECT count(*) as "userCount" FROM "vipUsers" WHERE "userID" = ?`, [nonAnonUserID])).userCount > 0;
|
||||
const isVIP = await isUserVIP(nonAnonUserID);
|
||||
|
||||
//check if user voting on own submission
|
||||
const isOwnSubmission = (await db.prepare("get", `SELECT "UUID" as "submissionCount" FROM "sponsorTimes" where "userID" = ? AND "UUID" = ?`, [nonAnonUserID, UUID])) !== undefined;
|
||||
|
||||
Reference in New Issue
Block a user