Merge pull request #350 from mchangrh/poi-min-start-time

add config key for poiMinimumStartTime
This commit is contained in:
Ajay Ramachandran 2021-08-31 12:25:17 -04:00 committed by GitHub
commit df904e3744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) {