Fix titles and thumbnails being unlocked

This commit is contained in:
Ajay 2024-01-28 22:05:04 -05:00
parent 4477ab7ca6
commit 59d9ed390f

View file

@ -102,7 +102,7 @@ export async function postBranding(req: Request, res: Response) {
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]);
} else {
await db.prepare("run", `UPDATE "titleVotes" as tv SET "locked" = 0 FROM "titles" t WHERE t."videoID" = ?`, [videoID]);
await db.prepare("run", `UPDATE "titleVotes" as tv SET "locked" = 0 FROM "titles" t WHERE tv."UUID" = t."UUID" AND t."videoID" = ?`, [videoID]);
}
}
@ -145,7 +145,7 @@ export async function postBranding(req: Request, res: Response) {
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]);
} else {
await db.prepare("run", `UPDATE "thumbnailVotes" as tv SET "locked" = 0 FROM "thumbnails" t WHERE t."videoID" = ?`, [videoID]);
await db.prepare("run", `UPDATE "thumbnailVotes" as tv SET "locked" = 0 FROM "thumbnails" t WHERE tv."UUID" = t."UUID" AND t."videoID" = ?`, [videoID]);
}
}
}