diff --git a/src/config.ts b/src/config.ts index cb985ab..2aaaf12 100644 --- a/src/config.ts +++ b/src/config.ts @@ -50,6 +50,7 @@ addDefaults(config, { userCounterURL: null, newLeafURLs: null, maxRewardTimePerSegmentInSeconds: 600, + poiMinimumStartTime: 2, postgres: null, dumpDatabase: { enabled: false, diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index dc834d6..4e946e9 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -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) {