mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-10 21:47:02 +03:00
Limit mute action type to specific categories
This commit is contained in:
@@ -348,8 +348,8 @@ function checkInvalidFields(videoID: any, userID: any, segments: Array<any>): Ch
|
||||
return CHECK_PASS;
|
||||
}
|
||||
|
||||
async function checkEachSegmentValid(userID: string, videoID: VideoID
|
||||
, segments: Array<any>, service: string, isVIP: boolean, lockedCategoryList: Array<any>): Promise<CheckResult> {
|
||||
async function checkEachSegmentValid(userID: string, videoID: VideoID,
|
||||
segments: Array<any>, service: string, isVIP: boolean, lockedCategoryList: Array<any>): Promise<CheckResult> {
|
||||
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
if (segments[i] === undefined || segments[i].segment === undefined || segments[i].category === undefined) {
|
||||
@@ -379,6 +379,10 @@ async function checkEachSegmentValid(userID: string, videoID: VideoID
|
||||
};
|
||||
}
|
||||
|
||||
if (!config.categorySupport[segments[i].category]?.includes(segments[i].actionType)) {
|
||||
return { pass: false, errorMessage: "ActionType is not supported with this category.", errorCode: 400 };
|
||||
}
|
||||
|
||||
const startTime = parseFloat(segments[i].segment[0]);
|
||||
const endTime = parseFloat(segments[i].segment[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user