mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Generated chapters can now start after 0 seconds, so allow importing them
This commit is contained in:
@@ -68,6 +68,8 @@ export function getHashParams(): Record<string, unknown> {
|
||||
|
||||
export function getExistingChapters(currentVideoID: VideoID, duration: number): SponsorTime[] {
|
||||
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
|
||||
const title = document.querySelector("[target-id=engagement-panel-macro-markers-auto-chapters] #title-text");
|
||||
if (title?.textContent?.includes("Key moment")) return [];
|
||||
|
||||
const chapters: SponsorTime[] = [];
|
||||
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
|
||||
@@ -103,11 +105,6 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
|
||||
}
|
||||
}
|
||||
|
||||
if (chapters[0] && chapters[0].segment[0] !== 0) {
|
||||
// This is key moments instead of chapters, don't import as they are not full sections
|
||||
return [];
|
||||
}
|
||||
|
||||
return chapters;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user