mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Filter input
This commit is contained in:
parent
c9b18a4938
commit
77a1799a7f
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ export async function deleteLockCategoriesEndpoint(req: DeleteLockCategoriesRequ
|
|||
|
||||
export async function deleteLockCategories(videoID: VideoID, categories = config.categoryList, actionTypes = [ActionType.Skip, ActionType.Mute], service: Service): Promise<void> {
|
||||
const arrJoin = (arr: string[]): string => `'${arr.join(`','`)}'`;
|
||||
const categoryString = arrJoin(categories);
|
||||
const actionTypeString = arrJoin(actionTypes);
|
||||
const categoryString = arrJoin(categories.filter((v) => !/[^a-z|_|-]/.test(v)));
|
||||
const actionTypeString = arrJoin(actionTypes.filter((v) => !/[^a-z|_|-]/.test(v)));
|
||||
await db.prepare("run", `DELETE FROM "lockCategories" WHERE "videoID" = ? AND "service" = ? AND "category" IN (${categoryString}) AND "actionType" IN (${actionTypeString})`, [videoID, service]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue