mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Fix segment autoskip not being defined sometimes.
This commit is contained in:
		
							parent
							
								
									bc636b4064
								
							
						
					
					
						commit
						fe22731192
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -647,11 +647,6 @@ export default {
 | 
				
			||||||
            if (markers) markers.style.background = `linear-gradient(${array.join(",")})`;
 | 
					            if (markers) markers.style.background = `linear-gradient(${array.join(",")})`;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        updateSponsors() {
 | 
					        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)) {
 | 
					            if (this.getPreferenceBoolean("showMarkers", true)) {
 | 
				
			||||||
                this.shakaPromise.then(() => {
 | 
					                this.shakaPromise.then(() => {
 | 
				
			||||||
                    this.updateMarkers();
 | 
					                    this.updateMarkers();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -444,6 +444,11 @@ export default {
 | 
				
			||||||
                category: JSON.stringify(selectedSkip),
 | 
					                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);
 | 
					            const minSegmentLength = Math.max(this.getPreferenceNumber("minSegmentLength", 0), 0);
 | 
				
			||||||
            sponsors.segments = sponsors.segments?.filter(segment => {
 | 
					            sponsors.segments = sponsors.segments?.filter(segment => {
 | 
				
			||||||
                const length = segment.segment[1] - segment.segment[0];
 | 
					                const length = segment.segment[1] - segment.segment[0];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue