Skip to content

Commit

Permalink
Fix segment autoskip not being defined sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMasterK committed Aug 7, 2023
1 parent bc636b4 commit fe22731
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/components/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions src/components/WatchVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit fe22731

Please sign in to comment.