mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Fix chapter import not working with 0 time
This commit is contained in:
@@ -79,7 +79,7 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
|
|||||||
const description = link.querySelector("#details h4") as HTMLElement;
|
const description = link.querySelector("#details h4") as HTMLElement;
|
||||||
if (timeElement && description?.innerText?.length > 0 && link.getAttribute("href")?.includes(currentVideoID)) {
|
if (timeElement && description?.innerText?.length > 0 && link.getAttribute("href")?.includes(currentVideoID)) {
|
||||||
const time = GenericUtils.getFormattedTimeToSeconds(timeElement.innerText);
|
const time = GenericUtils.getFormattedTimeToSeconds(timeElement.innerText);
|
||||||
if (!time) return [];
|
if (time === null) return [];
|
||||||
|
|
||||||
if (lastSegment) {
|
if (lastSegment) {
|
||||||
lastSegment.segment[1] = time;
|
lastSegment.segment[1] = time;
|
||||||
|
|||||||
Reference in New Issue
Block a user