Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into switch-axios

This commit is contained in:
Michael C
2021-09-26 18:13:27 -04:00
93 changed files with 2682 additions and 2953 deletions

View File

@@ -1,13 +1,13 @@
import {Request, Response} from "express";
import {Logger} from "../utils/logger";
import {isUserVIP} from "../utils/isUserVIP";
import {getMaxResThumbnail, YouTubeAPI} from "../utils/youtubeApi";
import {db, privateDB} from "../databases/databases";
import {dispatchEvent, getVoteAuthor, getVoteAuthorRaw} from "../utils/webhookUtils";
import {getFormattedTime} from "../utils/getFormattedTime";
import {getIP} from "../utils/getIP";
import {getHash} from "../utils/getHash";
import {config} from "../config";
import { Request, Response } from "express";
import { Logger } from "../utils/logger";
import { isUserVIP } from "../utils/isUserVIP";
import { getMaxResThumbnail, YouTubeAPI } from "../utils/youtubeApi";
import { db, privateDB } from "../databases/databases";
import { dispatchEvent, getVoteAuthor, getVoteAuthorRaw } from "../utils/webhookUtils";
import { getFormattedTime } from "../utils/getFormattedTime";
import { getIP } from "../utils/getIP";
import { getHash } from "../utils/getHash";
import { config } from "../config";
import { UserID } from "../types/user.model";
import { Category, CategoryActionType, HashedIP, IPAddress, SegmentUUID, Service, VideoID, VideoIDHash, Visibility } from "../types/segments.model";
import { getCategoryActionType } from "../utils/categoryInfo";
@@ -135,7 +135,7 @@ async function sendWebhooks(voteData: VoteData) {
},
}],
})
.then(async res => {
.then(res => {
if (res.status >= 400) {
Logger.error("Error sending reported submission Discord hook");
Logger.error(JSON.stringify((res.data)));
@@ -453,6 +453,6 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise<Re
return res.status(finalResponse.finalStatus).send(finalResponse.finalMessage ?? undefined);
} catch (err) {
Logger.error(err as string);
return res.status(500).json({error: "Internal error creating segment vote"});
return res.status(500).json({ error: "Internal error creating segment vote" });
}
}