mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
voteOnSponsorTime: check for VIP/ownSubmission before doing math in categoryVote
This commit is contained in:
@@ -291,7 +291,7 @@ async function categoryVote(UUID: SegmentUUID, userID: UserID, isVIP: boolean, i
|
|||||||
|
|
||||||
//TODO: In the future, raise this number from zero to make it harder to change categories
|
//TODO: In the future, raise this number from zero to make it harder to change categories
|
||||||
// VIPs change it every time
|
// VIPs change it every time
|
||||||
if (nextCategoryCount - currentCategoryCount >= Math.max(Math.ceil(submissionInfo?.votes / 2), 2) || isVIP || isTempVIP || isOwnSubmission) {
|
if (isVIP || isTempVIP || isOwnSubmission || nextCategoryCount - currentCategoryCount >= Math.max(Math.ceil(submissionInfo?.votes / 2), 2)) {
|
||||||
// Replace the category
|
// Replace the category
|
||||||
await db.prepare("run", `update "sponsorTimes" set "category" = ? where "UUID" = ?`, [category, UUID]);
|
await db.prepare("run", `update "sponsorTimes" set "category" = ? where "UUID" = ?`, [category, UUID]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user