Skip to content

Commit

Permalink
Improve logic for selecting statements in CaptionsExtractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Jun 27, 2024
1 parent b40f9d9 commit a9a8d19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/VideoDebate/CaptionsExtractor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ const getStatementsAtPosition = (statements, caption, nextCaption) => {

const selected = []
for (const statement of statements) {
if (statement.time >= caption.start) {
if (!nextCaption || statement.time < nextCaption.start) {
if (statement.time >= Math.floor(caption.start)) {
if (!nextCaption || Math.floor(nextCaption.start) > statement.time) {
selected.push(statement)
} else {
break
Expand Down

0 comments on commit a9a8d19

Please sign in to comment.