From 155c5a9b97432048f36caa2fc11478d2f3b5afba Mon Sep 17 00:00:00 2001 From: Ajay Date: Sat, 12 Feb 2022 00:05:01 -0500 Subject: [PATCH] Don't allow upvoting dead locked category segment for full video --- src/routes/voteOnSponsorTime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/voteOnSponsorTime.ts b/src/routes/voteOnSponsorTime.ts index 7c7747c..0b15944 100644 --- a/src/routes/voteOnSponsorTime.ts +++ b/src/routes/voteOnSponsorTime.ts @@ -375,8 +375,8 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID return categoryVote(UUID, nonAnonUserID, isVIP, isTempVIP, isOwnSubmission, category, hashedIP, finalResponse); } - // If not upvote - if (!isVIP && type != 1) { + // If not upvote, or an upvote on a dead segment (for ActionType.Full) + if (!isVIP && (type != 1 || segmentInfo.votes <= -2)) { const isSegmentLocked = segmentInfo.locked; const isVideoLocked = async () => !!(await db.prepare("get", `SELECT "category" FROM "lockCategories" WHERE "videoID" = ? AND "service" = ? AND "category" = ? AND "actionType" = ?`,