mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 20:17:02 +03:00
Check dearrow vote history for new submitters
This commit is contained in:
@@ -58,6 +58,14 @@ async function oldDeArrowSubmitterOrAllowed(userID: HashedUserID): Promise<boole
|
|||||||
|
|
||||||
const isOldSubmitter = result.submissionCount >= 1;
|
const isOldSubmitter = result.submissionCount >= 1;
|
||||||
if (!isOldSubmitter) {
|
if (!isOldSubmitter) {
|
||||||
|
if (!submitterThreshold) {
|
||||||
|
const voteResult = await db.prepare("get", `SELECT "UUID" from "titleVotes" where "userID" = ?`, [userID], { useReplica: true });
|
||||||
|
if (voteResult?.UUID) {
|
||||||
|
// Count at least one vote as an old submitter as well
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await redis.zRemRangeByScore("submittersDeArrow", "-inf", Date.now() - fiveMinutes);
|
await redis.zRemRangeByScore("submittersDeArrow", "-inf", Date.now() - fiveMinutes);
|
||||||
const last5MinUsers = await redis.zCard("submittersDeArrow");
|
const last5MinUsers = await redis.zCard("submittersDeArrow");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user