diff --git a/frontend/src/components/VideoPlayer.tsx b/frontend/src/components/VideoPlayer.tsx index 63edf527..339d2706 100644 --- a/frontend/src/components/VideoPlayer.tsx +++ b/frontend/src/components/VideoPlayer.tsx @@ -158,10 +158,16 @@ const VideoPlayer = ({ watched: boolean, setSponsorSegmentSkipped?: Dispatch>, ) => - async () => { - if (!watched) { - // Check if video is already marked as watched - await updateWatchedState({ id: youtubeId, is_watched: true }); + async (videoTag: VideoTag) => { + const currentTime = Number(videoTag.currentTarget.currentTime); + + const videoProgressResponse = await updateVideoProgressById({ + youtubeId, + currentProgress: currentTime, + }); + + if (videoProgressResponse.watched && watched !== videoProgressResponse.watched) { + onWatchStateChanged?.(true); } setSponsorSegmentSkipped?.((segments: SponsorSegmentsSkippedType) => {