From c3cbc44d2897221bcb41ff6f02c0bfb56d6a6640 Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 23 Jan 2025 05:18:49 -0500 Subject: [PATCH] Fix hiding segments not working on videos with YouTube chapters Fixes #2194 --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 6c646a7b..1a20209c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -199,7 +199,7 @@ export default class Utils { getSponsorIndexFromUUID(sponsorTimes: SponsorTime[], UUID: string): number { for (let i = 0; i < sponsorTimes.length; i++) { - if (sponsorTimes[i].UUID.startsWith(UUID) || UUID.startsWith(sponsorTimes[i].UUID)) { + if (sponsorTimes[i].UUID && (sponsorTimes[i].UUID.startsWith(UUID) || UUID.startsWith(sponsorTimes[i].UUID))) { return i; } } @@ -320,6 +320,7 @@ export default class Utils { allDownvotes[hashedVideoID] = currentVideoData; } + console.log(allDownvotes) const entries = Object.entries(allDownvotes); if (entries.length > 10000) {