From f5261496314c08890f145b72a0550bab94c32f9f Mon Sep 17 00:00:00 2001 From: sean Date: Thu, 12 Sep 2024 02:32:19 -0500 Subject: [PATCH] fix(findSubtitle): add start index to final index after slice (#2460) --- frontend/src/components/Playback/SubtitleTrack.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Playback/SubtitleTrack.vue b/frontend/src/components/Playback/SubtitleTrack.vue index e15a951a014..bb9920b74dd 100644 --- a/frontend/src/components/Playback/SubtitleTrack.vue +++ b/frontend/src/components/Playback/SubtitleTrack.vue @@ -42,7 +42,7 @@ const predicate = (d: Dialogue) => d.start <= playbackManager.currentTime && d.e const findSubtitle = (dialogue: ParsedSubtitleTrack['dialogue'], start = 0) => { const index = dialogue.slice(start).findIndex(d => predicate(d)); - return index === -1 ? undefined : index; + return index === -1 ? undefined : index + start; }; const dialogue = computed(() => playerElement.currentExternalSubtitleTrack?.parsed?.dialogue);