Get all sponsorblock segment types (testing) (#1021)

* Pull all sponsorblock segment types

* Respect segment skip on `segment.actionType`

* Lint with `prettier`

* Lint with `black`
This commit is contained in:
Atinoda
2025-08-11 09:06:12 +01:00
committed by GitHub
parent dc26354020
commit bcb216d862
2 changed files with 31 additions and 4 deletions

View File

@@ -70,9 +70,11 @@ const handleTimeUpdate =
if (sponsorBlock && sponsorBlock.segments) {
sponsorBlock.segments.forEach((segment: SponsorBlockSegmentType) => {
const actionType = segment.actionType;
const doSkip = actionType == 'skip';
const [from, to] = segment.segment;
if (currentTime >= from && currentTime <= from + 0.3) {
if (doSkip && currentTime >= from && currentTime <= from + 0.3) {
videoTag.currentTarget.currentTime = to;
setSponsorSegmentSkipped?.((segments: SponsorSegmentsSkippedType) => {