mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Fix key moments importing as chapters
This commit is contained in:
parent
5d62b11a6d
commit
49a166a6b2
1 changed files with 2 additions and 1 deletions
|
@ -70,7 +70,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
|
||||||
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
|
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
|
||||||
|
|
||||||
const chapters: SponsorTime[] = [];
|
const chapters: SponsorTime[] = [];
|
||||||
if (chaptersBox) {
|
// .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)) {
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in a new issue