From fe227311921d4c58374dfd6333c7752d5b161ad2 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:00:02 +0100 Subject: [PATCH] Fix segment autoskip not being defined sometimes. --- src/components/VideoPlayer.vue | 5 ----- src/components/WatchVideo.vue | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 9e1fb5fc..3fd30b1f 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -647,11 +647,6 @@ export default { if (markers) markers.style.background = `linear-gradient(${array.join(",")})`; }, updateSponsors() { - const skipOptions = this.getPreferenceJSON("skipOptions", {}); - this.sponsors?.segments?.forEach(segment => { - const option = skipOptions[segment.category]; - segment.autoskip = option === undefined || option === "auto"; - }); if (this.getPreferenceBoolean("showMarkers", true)) { this.shakaPromise.then(() => { this.updateMarkers(); diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 85952223..9cf5586a 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -444,6 +444,11 @@ export default { category: JSON.stringify(selectedSkip), }); + sponsors?.segments?.forEach(segment => { + const option = skipOptions[segment.category]; + segment.autoskip = option === undefined || option === "auto"; + }); + const minSegmentLength = Math.max(this.getPreferenceNumber("minSegmentLength", 0), 0); sponsors.segments = sponsors.segments?.filter(segment => { const length = segment.segment[1] - segment.segment[0];