From a921085da6e5478774179daf9e82d526a73d613a Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 21 Mar 2024 19:28:05 -0400 Subject: [PATCH] Fix vip downvotes unlocking --- src/routes/postBranding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/postBranding.ts b/src/routes/postBranding.ts index 16a8f5c..23e8f6d 100644 --- a/src/routes/postBranding.ts +++ b/src/routes/postBranding.ts @@ -104,7 +104,7 @@ export async function postBranding(req: Request, res: Response) { await verifyOldSubmissions(hashedUserID, verificationValue); } - if (isVip) { + if (isVip && !downvote) { // unlock all other titles if (shouldLock) { await db.prepare("run", `UPDATE "titleVotes" as tv SET "locked" = 0 FROM "titles" t WHERE tv."UUID" = t."UUID" AND tv."UUID" != ? AND t."videoID" = ?`, [UUID, videoID]); @@ -152,7 +152,7 @@ export async function postBranding(req: Request, res: Response) { } } - if (isVip) { + if (isVip && !downvote) { // unlock all other titles if (shouldLock) { await db.prepare("run", `UPDATE "thumbnailVotes" as tv SET "locked" = 0 FROM "thumbnails" t WHERE tv."UUID" = t."UUID" AND tv."UUID" != ? AND t."videoID" = ?`, [UUID, videoID]);