From 404d9046d334b1c705b4068deceade708f35c78d Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Wed, 16 Oct 2024 00:48:39 -0700 Subject: [PATCH] add filtering for markers labeled 'end of' --- src/app/(core)/v/[slug]/player.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/(core)/v/[slug]/player.tsx b/src/app/(core)/v/[slug]/player.tsx index dedde39..66a520f 100644 --- a/src/app/(core)/v/[slug]/player.tsx +++ b/src/app/(core)/v/[slug]/player.tsx @@ -97,7 +97,7 @@ export const VodPlayer = (props: { id: string; vod: VOD }) => { presentational: "0", totalSeconds: 0, }); - const csv = mockedMarkers.map((marker, id) => { + const csv = mockedMarkers.flatMap((marker, id) => { let endTime = (mockedMarkers[id + 1]?.position_seconds ?? (videoDuration as duration.Duration)?.asSeconds?.()) - @@ -112,7 +112,9 @@ export const VodPlayer = (props: { id: string; vod: VOD }) => { 0 ); - return `${startTime},${endTime},${marker.description.replace(",", "")}`; + if (marker.description.toLowerCase().startsWith("end of")) return []; + + return [`${startTime},${endTime},${marker.description.replace(",", "")}`]; }); const ytChapters = mockedMarkers.reduce((acc, marker) => {