mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-13 02:14:32 +01:00
commit
bf2d033ac3
4 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,7 @@ addDefaults(config, {
|
||||||
privateDBSchema: "./databases/_private.db.sql",
|
privateDBSchema: "./databases/_private.db.sql",
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
webhooks: [],
|
webhooks: [],
|
||||||
categoryList: ["sponsor", "intro", "outro", "interaction", "selfpromo", "music_offtopic"],
|
categoryList: ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic"],
|
||||||
maxNumberOfActiveWarnings: 3,
|
maxNumberOfActiveWarnings: 3,
|
||||||
hoursAfterWarningExpires: 24,
|
hoursAfterWarningExpires: 24,
|
||||||
adminUserID: "",
|
adminUserID: "",
|
||||||
|
|
|
@ -136,7 +136,7 @@ export class Postgres implements IDatabase {
|
||||||
|
|
||||||
private processUpgradeQuery(query: string): string {
|
private processUpgradeQuery(query: string): string {
|
||||||
let result = query;
|
let result = query;
|
||||||
result = result.replace(/sha256\((.*?)\)/gm, "digest($1, 'sha256')");
|
result = result.replace(/sha256\((.*?)\)/gm, "encode(digest($1, 'sha256'), 'hex')");
|
||||||
result = result.replace(/integer/gmi, "NUMERIC");
|
result = result.replace(/integer/gmi, "NUMERIC");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -377,7 +377,8 @@ export async function postSkipSegments(req: Request, res: Response) {
|
||||||
videoDuration = apiVideoDuration || 0 as VideoDuration;
|
videoDuration = apiVideoDuration || 0 as VideoDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousSubmissions = await db.prepare('all', `SELECT "videoDuration", "UUID" FROM "sponsorTimes" WHERE "videoID" = ? AND "service" = ? AND "hidden" = 0 AND "shadowHidden" = 0 AND "votes" >= 0`, [videoID, service]) as
|
const previousSubmissions = await db.prepare('all', `SELECT "videoDuration", "UUID" FROM "sponsorTimes" WHERE "videoID" = ? AND "service" = ? AND "hidden" = 0
|
||||||
|
AND "shadowHidden" = 0 AND "votes" >= 0 AND "videoDuration" != 0`, [videoID, service]) as
|
||||||
{videoDuration: VideoDuration, UUID: SegmentUUID}[];
|
{videoDuration: VideoDuration, UUID: SegmentUUID}[];
|
||||||
// If the video's duration is changed, then the video should be unlocked and old submissions should be hidden
|
// If the video's duration is changed, then the video should be unlocked and old submissions should be hidden
|
||||||
const videoDurationChanged = previousSubmissions.length > 0 && !previousSubmissions.some((e) => Math.abs(videoDuration - e.videoDuration) < 2);
|
const videoDurationChanged = previousSubmissions.length > 0 && !previousSubmissions.some((e) => Math.abs(videoDuration - e.videoDuration) < 2);
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"categoryList": ["sponsor", "intro", "outro", "interaction", "selfpromo", "music_offtopic"],
|
"categoryList": ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic"],
|
||||||
"maxNumberOfActiveWarnings": 3,
|
"maxNumberOfActiveWarnings": 3,
|
||||||
"hoursAfterWarningExpires": 24,
|
"hoursAfterWarningExpires": 24,
|
||||||
"rateLimit": {
|
"rateLimit": {
|
||||||
|
|
Loading…
Reference in a new issue