mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-13 02:14:32 +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,
|
userCounterURL: null,
|
||||||
newLeafURLs: null,
|
newLeafURLs: null,
|
||||||
maxRewardTimePerSegmentInSeconds: 600,
|
maxRewardTimePerSegmentInSeconds: 600,
|
||||||
|
poiMinimumStartTime: 2,
|
||||||
postgres: null,
|
postgres: null,
|
||||||
dumpDatabase: {
|
dumpDatabase: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
|
|
@ -391,8 +391,8 @@ async function checkEachSegmentValid(userID: string, videoID: VideoID
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for POI segments before 1 second
|
// Check for POI segments before 1 second
|
||||||
if (getCategoryActionType(segments[i].category) === CategoryActionType.POI && startTime < 1) {
|
if (getCategoryActionType(segments[i].category) === CategoryActionType.POI && startTime < config.poiMinimumStartTime) {
|
||||||
return { pass: false, errorMessage: "POI must be after 1 second", errorCode: 400};
|
return { pass: false, errorMessage: `POI cannot be that early`, errorCode: 400};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVIP && segments[i].category === "sponsor" && Math.abs(startTime - endTime) < 1) {
|
if (!isVIP && segments[i].category === "sponsor" && Math.abs(startTime - endTime) < 1) {
|
||||||
|
|
Loading…
Reference in a new issue