Add another segment to overlap test case and fix for that case

This commit is contained in:
Ajay Ramachandran
2021-11-06 17:28:58 -04:00
parent 2733cd6606
commit c0072d5c72
2 changed files with 13 additions and 6 deletions

View File

@@ -281,7 +281,7 @@ function splitPercentOverlap(groups: OverlappingSegmentGroup[]): OverlappingSegm
const overlap = Math.min(segment.endTime, compareSegment.endTime) - Math.max(segment.startTime, compareSegment.startTime);
const overallDuration = Math.max(segment.endTime, compareSegment.endTime) - Math.min(segment.startTime, compareSegment.startTime);
const overlapPercent = overlap / overallDuration;
return (segment.actionType === compareSegment.actionType && segment.actionType !== ActionType.Chapter)
return (overlapPercent > 0 && segment.actionType === compareSegment.actionType && segment.actionType !== ActionType.Chapter)
|| overlapPercent >= 0.6
|| (overlapPercent >= 0.8 && segment.actionType === ActionType.Chapter && compareSegment.actionType === ActionType.Chapter);
});