mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-27 01:48:33 +03:00
logs
This commit is contained in:
@@ -102,6 +102,7 @@ async function checkVideoDuration(UUID: SegmentUUID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function sendWebhooks(voteData: VoteData) {
|
async function sendWebhooks(voteData: VoteData) {
|
||||||
|
Logger.error(`about to send webhook ${JSON.stringify(voteData)}`);
|
||||||
const submissionInfoRow = await db.prepare("get", `SELECT "s"."videoID", "s"."userID", s."startTime", s."endTime", s."category", u."userName",
|
const submissionInfoRow = await db.prepare("get", `SELECT "s"."videoID", "s"."userID", s."startTime", s."endTime", s."category", u."userName",
|
||||||
(select count(1) from "sponsorTimes" where "userID" = s."userID") count,
|
(select count(1) from "sponsorTimes" where "userID" = s."userID") count,
|
||||||
(select count(1) from "sponsorTimes" where "userID" = s."userID" and votes <= -2) disregarded
|
(select count(1) from "sponsorTimes" where "userID" = s."userID" and votes <= -2) disregarded
|
||||||
@@ -110,6 +111,8 @@ async function sendWebhooks(voteData: VoteData) {
|
|||||||
|
|
||||||
const userSubmissionCountRow = await db.prepare("get", `SELECT count(*) as "submissionCount" FROM "sponsorTimes" WHERE "userID" = ?`, [voteData.nonAnonUserID]);
|
const userSubmissionCountRow = await db.prepare("get", `SELECT count(*) as "submissionCount" FROM "sponsorTimes" WHERE "userID" = ?`, [voteData.nonAnonUserID]);
|
||||||
|
|
||||||
|
Logger.error(`Sending webhook ${config.discordReportChannelWebhookURL}, ${submissionInfoRow}, ${userSubmissionCountRow}`)
|
||||||
|
|
||||||
if (submissionInfoRow !== undefined && userSubmissionCountRow != undefined) {
|
if (submissionInfoRow !== undefined && userSubmissionCountRow != undefined) {
|
||||||
let webhookURL: string = null;
|
let webhookURL: string = null;
|
||||||
if (voteData.voteTypeEnum === voteTypes.normal) {
|
if (voteData.voteTypeEnum === voteTypes.normal) {
|
||||||
|
|||||||
Reference in New Issue
Block a user