mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Get all warnings
This commit is contained in:
parent
497a509d60
commit
1678dcac82
1 changed files with 2 additions and 4 deletions
|
@ -288,12 +288,10 @@ async function checkUserActiveWarning(userID: string): Promise<CheckResult> {
|
||||||
`SELECT "reason"
|
`SELECT "reason"
|
||||||
FROM warnings
|
FROM warnings
|
||||||
WHERE "userID" = ? AND "issueTime" > ? AND enabled = 1
|
WHERE "userID" = ? AND "issueTime" > ? AND enabled = 1
|
||||||
ORDER BY "issueTime" DESC
|
ORDER BY "issueTime" DESC`,
|
||||||
LIMIT ?`,
|
|
||||||
[
|
[
|
||||||
userID,
|
userID,
|
||||||
Math.floor(now - (config.hoursAfterWarningExpires * MILLISECONDS_IN_HOUR)),
|
Math.floor(now - (config.hoursAfterWarningExpires * MILLISECONDS_IN_HOUR))
|
||||||
config.maxNumberOfActiveWarnings
|
|
||||||
],
|
],
|
||||||
) as {reason: string}[]).sort((a, b) => (b?.reason?.length ?? 0) - (a?.reason?.length ?? 0));
|
) as {reason: string}[]).sort((a, b) => (b?.reason?.length ?? 0) - (a?.reason?.length ?? 0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue