Skip to content

Commit

Permalink
add filtering for markers labeled 'end of'
Browse files Browse the repository at this point in the history
  • Loading branch information
t3dotgg committed Oct 16, 2024
1 parent d1527dd commit 404d904
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/(core)/v/[slug]/player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?.()) -
Expand All @@ -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) => {
Expand Down

0 comments on commit 404d904

Please sign in to comment.