mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Add option to disable sponsorblock.
This commit is contained in:
		
							parent
							
								
									2baef230c7
								
							
						
					
					
						commit
						3ee745b19e
					
				
					 2 changed files with 20 additions and 10 deletions
				
			
		| 
						 | 
					@ -1,6 +1,15 @@
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
    <h1 class="uk-text-bold uk-text-center">Preferences</h1>
 | 
					    <h1 class="uk-text-bold uk-text-center">Preferences</h1>
 | 
				
			||||||
    <hr />
 | 
					    <hr />
 | 
				
			||||||
 | 
					    <h2>SponsorBlock</h2>
 | 
				
			||||||
 | 
					    <b>Enable Sponsorblock</b>
 | 
				
			||||||
 | 
					    <br />
 | 
				
			||||||
 | 
					    <input
 | 
				
			||||||
 | 
					        class="uk-checkbox"
 | 
				
			||||||
 | 
					        v-model="sponsorBlock"
 | 
				
			||||||
 | 
					        @change="onChange($event)"
 | 
				
			||||||
 | 
					        type="checkbox"
 | 
				
			||||||
 | 
					    />
 | 
				
			||||||
    <h2>Instances List</h2>
 | 
					    <h2>Instances List</h2>
 | 
				
			||||||
    <table class="uk-table">
 | 
					    <table class="uk-table">
 | 
				
			||||||
        <thead>
 | 
					        <thead>
 | 
				
			||||||
| 
						 | 
					@ -48,7 +57,8 @@ export default {
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            selectedInstance: null,
 | 
					            selectedInstance: null,
 | 
				
			||||||
            instances: []
 | 
					            instances: [],
 | 
				
			||||||
 | 
					            sponsorBlock: true
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
| 
						 | 
					@ -76,15 +86,20 @@ export default {
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (localStorage)
 | 
					        if (localStorage) {
 | 
				
			||||||
            this.selectedInstance =
 | 
					            this.selectedInstance =
 | 
				
			||||||
                localStorage.getItem("instance") ||
 | 
					                localStorage.getItem("instance") ||
 | 
				
			||||||
                "https://pipedapi.kavin.rocks";
 | 
					                "https://pipedapi.kavin.rocks";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.sponsorBlock = localStorage.getItem("sponsorblock") || true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
        onChange() {
 | 
					        onChange() {
 | 
				
			||||||
            if (localStorage)
 | 
					            if (localStorage) {
 | 
				
			||||||
                localStorage.setItem("instance", this.selectedInstance);
 | 
					                localStorage.setItem("instance", this.selectedInstance);
 | 
				
			||||||
 | 
					                localStorage.setItem("sponsorblock", this.sponsorBlock);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        sslScore(url) {
 | 
					        sslScore(url) {
 | 
				
			||||||
            return (
 | 
					            return (
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -295,14 +295,9 @@ export default {
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async getSponsors() {
 | 
					        async getSponsors() {
 | 
				
			||||||
            this.fetchSponsors().then(data => (this.sponsors = data));
 | 
					            if (!localStorage || localStorage.getItem("sponsorblock") !== false)
 | 
				
			||||||
 | 
					                this.fetchSponsors().then(data => (this.sponsors = data));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<style>
 | 
					 | 
				
			||||||
.vjs-current-time {
 | 
					 | 
				
			||||||
    display: block;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue