Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into pr/FlorianZahn/376

This commit is contained in:
Ajay Ramachandran
2021-10-03 13:11:25 -04:00
21 changed files with 232 additions and 62 deletions

View File

@@ -301,7 +301,8 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise<Re
if (!isVIP && type != 1) {
const isSegmentLocked = async () => !!(await db.prepare("get", `SELECT "locked" FROM "sponsorTimes" WHERE "UUID" = ?`, [UUID]))?.locked;
const isVideoLocked = async () => !!(await db.prepare("get", `SELECT "lockCategories".category from "lockCategories" left join "sponsorTimes"
on ("lockCategories"."videoID" = "sponsorTimes"."videoID" and "lockCategories".category = "sponsorTimes".category)
on ("lockCategories"."videoID" = "sponsorTimes"."videoID" and
"lockCategories"."service" = "sponsorTimes"."service" and "lockCategories".category = "sponsorTimes".category)
where "UUID" = ?`, [UUID]));
if (await isSegmentLocked() || await isVideoLocked()) {