From ef26f96f66987e08d88a4d44c29e60cbcf148ec3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 7 Jun 2022 23:23:18 +0200 Subject: [PATCH] Minor SponsorBlock fix --- Model/Player/Backends/MPVBackend.swift | 2 +- Model/Player/PlayerSponsorBlock.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Model/Player/Backends/MPVBackend.swift b/Model/Player/Backends/MPVBackend.swift index 5773be34..32c452e3 100644 --- a/Model/Player/Backends/MPVBackend.swift +++ b/Model/Player/Backends/MPVBackend.swift @@ -129,7 +129,7 @@ final class MPVBackend: PlayerBackend { if !preservingTime, let segment = self.model.sponsorBlock.segments.first, - segment.start > 4, + segment.end < 4, self.model.lastSkipped.isNil { self.seek(to: segment.endTime) { finished in diff --git a/Model/Player/PlayerSponsorBlock.swift b/Model/Player/PlayerSponsorBlock.swift index d1d4fdac..ef6bf6d1 100644 --- a/Model/Player/PlayerSponsorBlock.swift +++ b/Model/Player/PlayerSponsorBlock.swift @@ -24,7 +24,7 @@ extension PlayerModel { } if let segmentToSkip = nextSegments.last(where: { $0.endTime <= playerItemDuration ?? .zero }), - self.shouldSkip(segmentToSkip, at: time) + shouldSkip(segmentToSkip, at: time) { skip(segmentToSkip, at: time) } @@ -51,7 +51,7 @@ extension PlayerModel { guard isPlaying, !restoredSegments.contains(segment), Defaults[.sponsorBlockCategories].contains(segment.category), - segment.start > 4 + segment.end < 4 else { return false }