mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
commit
bf2d033ac3
4 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,7 @@ addDefaults(config, {
|
|||
privateDBSchema: "./databases/_private.db.sql",
|
||||
readOnly: false,
|
||||
webhooks: [],
|
||||
categoryList: ["sponsor", "intro", "outro", "interaction", "selfpromo", "music_offtopic"],
|
||||
categoryList: ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic"],
|
||||
maxNumberOfActiveWarnings: 3,
|
||||
hoursAfterWarningExpires: 24,
|
||||
adminUserID: "",
|
||||
|
|
|
@ -136,7 +136,7 @@ export class Postgres implements IDatabase {
|
|||
|
||||
private processUpgradeQuery(query: string): string {
|
||||
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");
|
||||
|
||||
return result;
|
||||
|
|
|
@ -377,7 +377,8 @@ export async function postSkipSegments(req: Request, res: Response) {
|
|||
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}[];
|
||||
// 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);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"categoryList": ["sponsor", "intro", "outro", "interaction", "selfpromo", "music_offtopic"],
|
||||
"categoryList": ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic"],
|
||||
"maxNumberOfActiveWarnings": 3,
|
||||
"hoursAfterWarningExpires": 24,
|
||||
"rateLimit": {
|
||||
|
|
Loading…
Reference in a new issue