mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-24 00:18:23 +03:00
Fix logger calls where this will be wrong
This commit is contained in:
@@ -75,7 +75,7 @@ async function sendWebhooks(apiVideoDetails: videoDetails, userID: string, video
|
|||||||
sendWebhookNotification(userID, videoID, UUID, userSubmissionCountRow.submissionCount, apiVideoDetails, {
|
sendWebhookNotification(userID, videoID, UUID, userSubmissionCountRow.submissionCount, apiVideoDetails, {
|
||||||
submissionStart: startTime,
|
submissionStart: startTime,
|
||||||
submissionEnd: endTime,
|
submissionEnd: endTime,
|
||||||
}, segmentInfo).catch(Logger.error);
|
}, segmentInfo).catch((e) => Logger.error(`sending webhooks: ${e}`));
|
||||||
|
|
||||||
// If it is a first time submission
|
// If it is a first time submission
|
||||||
// Then send a notification to discord
|
// Then send a notification to discord
|
||||||
@@ -388,7 +388,7 @@ async function updateDataIfVideoDurationChange(videoID: VideoID, service: Servic
|
|||||||
await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 WHERE "UUID" = ?`, [submission.UUID]);
|
await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 WHERE "UUID" = ?`, [submission.UUID]);
|
||||||
}
|
}
|
||||||
lockedCategoryList = [];
|
lockedCategoryList = [];
|
||||||
deleteLockCategories(videoID, null, null, service).catch(Logger.error);
|
deleteLockCategories(videoID, null, null, service).catch((e) => Logger.error(`deleting lock categories: ${e}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -612,7 +612,7 @@ export async function postSkipSegments(req: Request, res: Response): Promise<Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < segments.length; i++) {
|
for (let i = 0; i < segments.length; i++) {
|
||||||
sendWebhooks(apiVideoDetails, userID, videoID, UUIDs[i], segments[i], service).catch(Logger.error);
|
sendWebhooks(apiVideoDetails, userID, videoID, UUIDs[i], segments[i], service).catch((e) => Logger.error(`call send webhooks ${e}`));
|
||||||
}
|
}
|
||||||
return res.json(newSegments);
|
return res.json(newSegments);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function verifyTokenRequest(req: VerifyTokenRequest, res: Response)
|
|||||||
const identity = await getPatreonIdentity(tokens.accessToken);
|
const identity = await getPatreonIdentity(tokens.accessToken);
|
||||||
|
|
||||||
if (tokens.expiresIn < 15 * 24 * 60 * 60) {
|
if (tokens.expiresIn < 15 * 24 * 60 * 60) {
|
||||||
refreshToken(TokenType.patreon, licenseKey, tokens.refreshToken).catch(Logger.error);
|
refreshToken(TokenType.patreon, licenseKey, tokens.refreshToken).catch((e) => Logger.error(`refresh token: ${e}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* istanbul ignore else */
|
/* istanbul ignore else */
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ async function checkVideoDuration(UUID: SegmentUUID) {
|
|||||||
AND "hidden" = 0 AND "shadowHidden" = 0 AND
|
AND "hidden" = 0 AND "shadowHidden" = 0 AND
|
||||||
"actionType" != 'full' AND "votes" > -2`,
|
"actionType" != 'full' AND "votes" > -2`,
|
||||||
[videoID, service, latestSubmission.timeSubmitted]);
|
[videoID, service, latestSubmission.timeSubmitted]);
|
||||||
deleteLockCategories(videoID, null, null, service).catch(Logger.error);
|
deleteLockCategories(videoID, null, null, service).catch((e) => Logger.error(`delete lock categories after vote: ${e}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
|
|||||||
// no restrictions on checkDuration
|
// no restrictions on checkDuration
|
||||||
// check duration of all submissions on this video
|
// check duration of all submissions on this video
|
||||||
if (type <= 0) {
|
if (type <= 0) {
|
||||||
checkVideoDuration(UUID).catch(Logger.error);
|
checkVideoDuration(UUID).catch((e) => Logger.error(`checkVideoDuration: ${e}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -524,7 +524,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
|
|||||||
incrementAmount,
|
incrementAmount,
|
||||||
oldIncrementAmount,
|
oldIncrementAmount,
|
||||||
finalResponse
|
finalResponse
|
||||||
}).catch(Logger.error);
|
}).catch((e) => Logger.error(`Sending vote webhook: ${e}`));
|
||||||
}
|
}
|
||||||
return { status: finalResponse.finalStatus, message: finalResponse.finalMessage ?? undefined };
|
return { status: finalResponse.finalStatus, message: finalResponse.finalMessage ?? undefined };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user