From 51d63d20190687e06703ec31062afeffaf507b6a Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 2 Jun 2025 13:32:58 -0400 Subject: [PATCH] Fix small bug with sponsorblock task --- .../Services/SponsorBlock/SponsorBlockTask.bs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/playlet-lib/src/components/Services/SponsorBlock/SponsorBlockTask.bs b/playlet-lib/src/components/Services/SponsorBlock/SponsorBlockTask.bs index bed802c4..e59c1b48 100644 --- a/playlet-lib/src/components/Services/SponsorBlock/SponsorBlockTask.bs +++ b/playlet-lib/src/components/Services/SponsorBlock/SponsorBlockTask.bs @@ -105,8 +105,12 @@ function ShouldShowNotification(segment as object, categories as object) as bool return option = SponsorBlock.SegmentAction.AutoSkip or option = SponsorBlock.SegmentAction.ManualSkip end function -function PadHightlightSegment(segments as object, lengthSeconds as integer) as object - for each segment in segments +function PadHightlightSegment(skipSegments as object, lengthSeconds as integer) as object + if skipSegments = invalid + return invalid + end if + + for each segment in skipSegments if not segment.category = "poi_highlight" continue for end if @@ -131,5 +135,5 @@ function PadHightlightSegment(segments as object, lengthSeconds as integer) as o segment.end = segment.end + padding end for - return segments + return skipSegments end function