Skip to content

Commit 49a166a

Browse files
committed
Fix key moments importing as chapters
1 parent 5d62b11 commit 49a166a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/pageUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
7070
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
7171

7272
const chapters: SponsorTime[] = [];
73-
if (chaptersBox) {
73+
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
74+
if (chaptersBox && !(document.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
7475
let lastSegment: SponsorTime = null;
7576
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
7677
for (const link of links) {

0 commit comments

Comments
 (0)