mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-17 21:18:47 +03:00
Fix dearrow old submitter check
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { config } from "../config";
|
import { config } from "../config";
|
||||||
import { db } from "../databases/databases";
|
import { db, privateDB } from "../databases/databases";
|
||||||
import { Category } from "../types/segments.model";
|
import { Category } from "../types/segments.model";
|
||||||
import { Feature, HashedUserID } from "../types/user.model";
|
import { Feature, HashedUserID } from "../types/user.model";
|
||||||
import { hasFeature } from "./features";
|
import { hasFeature } from "./features";
|
||||||
@@ -59,7 +59,7 @@ async function oldDeArrowSubmitterOrAllowed(userID: HashedUserID): Promise<boole
|
|||||||
const isOldSubmitter = result.submissionCount >= 1;
|
const isOldSubmitter = result.submissionCount >= 1;
|
||||||
if (!isOldSubmitter) {
|
if (!isOldSubmitter) {
|
||||||
if (!submitterThreshold) {
|
if (!submitterThreshold) {
|
||||||
const voteResult = await db.prepare("get", `SELECT "UUID" from "titleVotes" where "userID" = ?`, [userID], { useReplica: true });
|
const voteResult = await privateDB.prepare("get", `SELECT "UUID" from "titleVotes" where "userID" = ?`, [userID], { useReplica: true });
|
||||||
if (voteResult?.UUID) {
|
if (voteResult?.UUID) {
|
||||||
// Count at least one vote as an old submitter as well
|
// Count at least one vote as an old submitter as well
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user