Skip to content

专注模式:同一时间开头的两章,高亮跟着时间走到下一章 - #432

Merged
PathGao merged 1 commit into
mainfrom
refactor/chapter-range
Oct 27, 2026
Merged

PathGao merged 1 commit into
mainfrom
refactor/chapter-range

Conversation

@PathGao

@PathGao PathGao commented Oct 27, 2026

Copy link
Copy Markdown
Owner

改了什么

简介里写的章节(YouTube)没有结束时间。两行时间戳相同、标题不同时,专注模式以前一直高亮第一章到视频结束,笔记却分得对:两处各自算「这一章到哪结束」,规则不一样。

现在由 MdgSites.chapterRanges 一处算:下一个开始时间更晚的章节的开头,否则这一章自己的 to,否则到结尾。专注模式和笔记共用。

验证

  • node scripts/selftest.mjs:39 个通过。新加的 content 测试(A、B 同在 0 秒,C 在 60 秒,都没有结束时间)在旧规则下失败。
  • Chrome(ego),B站 BV1btH36uEru(6 章):专注模式拖到 5、100、400、700、1000 秒,高亮的章节都对。
  • 同一页面里直接调打包进去的 MdgSites.chapterRanges:上面那组章节第 10 秒在 A,第 90 秒在 C。
  • 没测到:YouTube 真视频(避开 timedtext 限流)。

简介里写的章节没有结束时间,两行时间相同时,专注模式以前一直高亮第一章,笔记却分得对。章节到哪结束改由 sites.js chapterRanges 一处算,专注模式和笔记共用。
@PathGao
PathGao merged commit 1a4ed4c into main Oct 27, 2026
2 checks passed
@PathGao
PathGao deleted the refactor/chapter-range branch October 27, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant