Add support for sponsorblock's filler and highlight skipping.

This commit is contained in:
FireMasterK 2022-01-13 09:42:21 +00:00
parent 6f1bb9445d
commit 8f10ee5c72
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 22 additions and 0 deletions

View file

@ -62,6 +62,14 @@
@change="onChange($event)"
/>
<br />
<label for="chkSkipHighlight"><strong v-t="'actions.skip_highlight'" /></label>
<br />
<input id="chkSkipHighlight" v-model="skipHighlight" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkSkipFiller"><strong v-t="'actions.skip_filler_tangent'" /></label>
<br />
<input id="chkSkipFiller" v-model="skipFiller" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="ddlTheme"><strong v-t="'actions.theme'" /></label>
<br />
<select id="ddlTheme" v-model="selectedTheme" class="select w-auto" @change="onChange($event)">
@ -193,6 +201,8 @@ export default {
skipInteraction: true,
skipSelfPromo: true,
skipMusicOffTopic: true,
skipHighlight: false,
skipFiller: false,
selectedTheme: "dark",
autoPlayVideo: true,
listen: false,
@ -288,6 +298,8 @@ export default {
this.skipInteraction =
this.skipSelfPromo =
this.skipMusicOffTopic =
this.skipHighlight =
this.skipFiller =
false;
skipList.forEach(skip => {
switch (skip) {
@ -312,6 +324,12 @@ export default {
case "music_offtopic":
this.skipMusicOffTopic = true;
break;
case "poi_highlight":
this.skipHighlight = true;
break;
case "filler":
this.skipFiller = true;
break;
default:
console.log("Unknown sponsor type: " + skip);
break;
@ -368,6 +386,8 @@ export default {
if (this.skipInteraction) sponsorSelected.push("interaction");
if (this.skipSelfPromo) sponsorSelected.push("selfpromo");
if (this.skipMusicOffTopic) sponsorSelected.push("music_offtopic");
if (this.skipHighlight) sponsorSelected.push("poi_highlight");
if (this.skipFiller) sponsorSelected.push("filler");
localStorage.setItem("selectedSkip", sponsorSelected);
localStorage.setItem("theme", this.selectedTheme);

View file

@ -30,6 +30,8 @@
"skip_interaction": "Skip Interaction Reminder (Subscribe)",
"skip_self_promo": "Skip Unpaid/Self Promotion",
"skip_non_music": "Skip Music: Non-Music Section",
"skip_highlight": "Skip Highlight",
"skip_filler_tangent": "Skip Filler Tangent",
"theme": "Theme",
"auto": "Auto",
"dark": "Dark",