mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-31 21:59:39 +03:00
No more verification through sb submissions
This commit is contained in:
@@ -218,9 +218,8 @@ async function updateVoteTotals(type: BrandingType, UUID: BrandingUUID, shouldLo
|
|||||||
|
|
||||||
export async function getVerificationValue(hashedUserID: HashedUserID, isVip: boolean): Promise<number> {
|
export async function getVerificationValue(hashedUserID: HashedUserID, isVip: boolean): Promise<number> {
|
||||||
const voteSum = await db.prepare("get", `SELECT SUM("maxVotes") as "voteSum" FROM (SELECT MAX("votes") as "maxVotes" from "titles" JOIN "titleVotes" ON "titles"."UUID" = "titleVotes"."UUID" WHERE "titles"."userID" = ? GROUP BY "titles"."videoID") t`, [hashedUserID]);
|
const voteSum = await db.prepare("get", `SELECT SUM("maxVotes") as "voteSum" FROM (SELECT MAX("votes") as "maxVotes" from "titles" JOIN "titleVotes" ON "titles"."UUID" = "titleVotes"."UUID" WHERE "titles"."userID" = ? GROUP BY "titles"."videoID") t`, [hashedUserID]);
|
||||||
const sbSubmissions = () => db.prepare("get", `SELECT COUNT(*) as count FROM "sponsorTimes" WHERE "userID" = ? AND "votes" > 0 LIMIT 3`, [hashedUserID]);
|
|
||||||
|
|
||||||
if (voteSum.voteSum >= 1 || isVip || (await sbSubmissions()).count > 2 || await hasFeature(hashedUserID, Feature.DeArrowTitleSubmitter)) {
|
if (voteSum.voteSum >= 1 || isVip || await hasFeature(hashedUserID, Feature.DeArrowTitleSubmitter)) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user