Fix key moments check not working when multiple videos present

This commit is contained in:
Ajay
2022-10-30 20:36:05 -04:00
parent ef8c5f58c5
commit 6db498ccb1

View File

@@ -71,7 +71,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
const chapters: SponsorTime[] = []; const chapters: SponsorTime[] = [];
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided // .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
if (chaptersBox && !(document.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) { if (chaptersBox && !(getControls()?.parentElement?.parentElement
?.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
let lastSegment: SponsorTime = null; let lastSegment: SponsorTime = null;
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a"); const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
for (const link of links) { for (const link of links) {