Skip to content

Commit

Permalink
renamed repeat variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Aug 25, 2024
1 parent 61fda09 commit 87f107f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5486,16 +5486,16 @@ function formatYoutubeSubtitles(subtitles, isAsr = false) {

const tokens = [];
let lastSegDuration = durationMs;
for (let i = 0; i < subtitle.segs.length; i++) {
const seg = subtitle.segs[i];
for (let j = 0; j < subtitle.segs.length; j++) {
const seg = subtitle.segs[j];
const text = seg.utf8.trim();
if (text === "\n") {
continue;
}

const offset = seg.tOffsetMs ?? 0;
let segDuration = durationMs;
const nextSeg = subtitle.segs[i + 1];
const nextSeg = subtitle.segs[j + 1];
if (nextSeg?.tOffsetMs) {
segDuration = nextSeg.tOffsetMs - offset;
lastSegDuration -= segDuration;
Expand Down
6 changes: 3 additions & 3 deletions src/subtitles.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ function formatYoutubeSubtitles(subtitles, isAsr = false) {

const tokens = [];
let lastSegDuration = durationMs;
for (let i = 0; i < subtitle.segs.length; i++) {
const seg = subtitle.segs[i];
for (let j = 0; j < subtitle.segs.length; j++) {
const seg = subtitle.segs[j];
const text = seg.utf8.trim();
if (text === "\n") {
continue;
}

const offset = seg.tOffsetMs ?? 0;
let segDuration = durationMs;
const nextSeg = subtitle.segs[i + 1];
const nextSeg = subtitle.segs[j + 1];
if (nextSeg?.tOffsetMs) {
segDuration = nextSeg.tOffsetMs - offset;
lastSegDuration -= segDuration;
Expand Down

0 comments on commit 87f107f

Please sign in to comment.