Fix segments always coming back as skip

This commit is contained in:
Ajay
2022-01-20 19:07:34 -05:00
parent acc983b829
commit 985039a86b

View File

@@ -88,7 +88,7 @@ async function getSegmentsByVideoID(req: Request, videoID: VideoID, categories:
if (forcePoiAsSkip) { if (forcePoiAsSkip) {
processedSegments = processedSegments.map((segment) => ({ processedSegments = processedSegments.map((segment) => ({
...segment, ...segment,
actionType: ActionType.Skip actionType: segment.actionType === ActionType.Poi ? ActionType.Skip : segment.actionType
})); }));
} }
@@ -145,7 +145,7 @@ async function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash,
if (forcePoiAsSkip) { if (forcePoiAsSkip) {
data.segments = data.segments.map((segment) => ({ data.segments = data.segments.map((segment) => ({
...segment, ...segment,
actionType: ActionType.Skip actionType: segment.actionType === ActionType.Poi ? ActionType.Skip : segment.actionType
})); }));
} }