mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
Remove username restriction
This commit is contained in:
@@ -70,16 +70,6 @@ export async function setUsername(req: Request, res: Response): Promise<Response
|
|||||||
if (await isUserBanned(hashedUserID)) {
|
if (await isUserBanned(hashedUserID)) {
|
||||||
return res.sendStatus(200);
|
return res.sendStatus(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
const [segments, titles, thumbs] = await Promise.all([
|
|
||||||
db.prepare("get", `SELECT count(*) AS "count" FROM "sponsorTimes" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
|
|
||||||
db.prepare("get", `SELECT count(*) AS "count" FROM "titles" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
|
|
||||||
db.prepare("get", `SELECT count(*) AS "count" FROM "thumbnails" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
|
|
||||||
]) as {count: number}[];
|
|
||||||
|
|
||||||
if (segments.count === 0 && titles.count === 0 && thumbs.count === 0) {
|
|
||||||
return res.sendStatus(200);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) /* istanbul ignore next */ {
|
catch (error) /* istanbul ignore next */ {
|
||||||
|
|||||||
Reference in New Issue
Block a user