add config key for poiMinimumStartTime

This commit is contained in:
Michael C 2021-08-29 21:43:21 -04:00
parent 9f762ac206
commit aab95a1adc
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
2 changed files with 3 additions and 2 deletions

View file

@ -50,6 +50,7 @@ addDefaults(config, {
userCounterURL: null,
newLeafURLs: null,
maxRewardTimePerSegmentInSeconds: 600,
poiMinimumStartTime: 2,
postgres: null,
dumpDatabase: {
enabled: false,

View file

@ -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) {