mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-10 05:27:00 +03:00
Old submitter only
This commit is contained in:
@@ -19,6 +19,13 @@ async function lowDownvotes(userID: HashedUserID): Promise<boolean> {
|
|||||||
return result.submissionCount > 5 && result.downvotedSubmissions / result.submissionCount < 0.10;
|
return result.submissionCount > 5 && result.downvotedSubmissions / result.submissionCount < 0.10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function oldSubmitter(userID: HashedUserID): Promise<boolean> {
|
||||||
|
const result = await db.prepare("get", `SELECT count(*) as "submissionCount" FROM "sponsorTimes" WHERE "userID" = ? AND "timeSubmitted" < 1743827196000`
|
||||||
|
, [userID], { useReplica: true });
|
||||||
|
|
||||||
|
return result.submissionCount > 1;
|
||||||
|
}
|
||||||
|
|
||||||
export async function canSubmit(userID: HashedUserID, category: Category): Promise<CanSubmitResult> {
|
export async function canSubmit(userID: HashedUserID, category: Category): Promise<CanSubmitResult> {
|
||||||
switch (category) {
|
switch (category) {
|
||||||
case "chapter":
|
case "chapter":
|
||||||
@@ -32,8 +39,10 @@ export async function canSubmit(userID: HashedUserID, category: Category): Promi
|
|||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return {
|
return {
|
||||||
canSubmit: true,
|
canSubmit: await oneOf([isUserVIP(userID),
|
||||||
reason: ""
|
oldSubmitter(userID)
|
||||||
|
]),
|
||||||
|
reason: "We are currently experiencing a mass spam attack"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user