mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Merge pull request #350 from mchangrh/poi-min-start-time
add config key for poiMinimumStartTime
This commit is contained in:
commit
df904e3744
2 changed files with 3 additions and 2 deletions
|
@ -50,6 +50,7 @@ addDefaults(config, {
|
|||
userCounterURL: null,
|
||||
newLeafURLs: null,
|
||||
maxRewardTimePerSegmentInSeconds: 600,
|
||||
poiMinimumStartTime: 2,
|
||||
postgres: null,
|
||||
dumpDatabase: {
|
||||
enabled: false,
|
||||
|
|
|
@ -391,8 +391,8 @@ async function checkEachSegmentValid(userID: string, videoID: VideoID
|
|||
}
|
||||
|
||||
// Check for POI segments before 1 second
|
||||
if (getCategoryActionType(segments[i].category) === CategoryActionType.POI && startTime < 1) {
|
||||
return { pass: false, errorMessage: "POI must be after 1 second", errorCode: 400};
|
||||
if (getCategoryActionType(segments[i].category) === CategoryActionType.POI && startTime < config.poiMinimumStartTime) {
|
||||
return { pass: false, errorMessage: `POI cannot be that early`, errorCode: 400};
|
||||
}
|
||||
|
||||
if (!isVIP && segments[i].category === "sponsor" && Math.abs(startTime - endTime) < 1) {
|
||||
|
|
Loading…
Reference in a new issue