mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-22 20:47:00 +00:00
Add an option to ignore short sponsorblock segments
This commit is contained in:
parent
e1b355e92a
commit
d980edd843
@ -266,6 +266,16 @@
|
|||||||
@change="onChange($event)"
|
@change="onChange($event)"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="pref" for="txtMinSegmentLength">
|
||||||
|
<strong v-t="'actions.min_segment_length'" />
|
||||||
|
<input
|
||||||
|
id="txtMinSegmentLength"
|
||||||
|
v-model="minSegmentLength"
|
||||||
|
class="input w-24"
|
||||||
|
type="text"
|
||||||
|
@change="onChange($event)"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="text-center" v-t="'titles.instance'" />
|
<h2 class="text-center" v-t="'titles.instance'" />
|
||||||
<label class="pref" for="ddlInstanceSelection">
|
<label class="pref" for="ddlInstanceSelection">
|
||||||
@ -395,6 +405,7 @@ export default {
|
|||||||
skipHighlight: "no",
|
skipHighlight: "no",
|
||||||
skipFiller: "no",
|
skipFiller: "no",
|
||||||
showMarkers: true,
|
showMarkers: true,
|
||||||
|
minSegmentLength: 0,
|
||||||
selectedTheme: "dark",
|
selectedTheme: "dark",
|
||||||
autoPlayVideo: true,
|
autoPlayVideo: true,
|
||||||
listen: false,
|
listen: false,
|
||||||
@ -551,6 +562,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.showMarkers = this.getPreferenceBoolean("showMarkers", true);
|
this.showMarkers = this.getPreferenceBoolean("showMarkers", true);
|
||||||
|
this.minSegmentLength = Math.max(Number(localStorage.getItem("minSegmentLength")), 0);
|
||||||
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
||||||
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
||||||
this.listen = this.getPreferenceBoolean("listen", false);
|
this.listen = this.getPreferenceBoolean("listen", false);
|
||||||
@ -613,6 +625,7 @@ export default {
|
|||||||
localStorage.setItem("skipOptions", JSON.stringify(skipOptions));
|
localStorage.setItem("skipOptions", JSON.stringify(skipOptions));
|
||||||
|
|
||||||
localStorage.setItem("showMarkers", this.showMarkers);
|
localStorage.setItem("showMarkers", this.showMarkers);
|
||||||
|
localStorage.setItem("minSegmentLength", this.minSegmentLength);
|
||||||
localStorage.setItem("theme", this.selectedTheme);
|
localStorage.setItem("theme", this.selectedTheme);
|
||||||
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
||||||
localStorage.setItem("listen", this.listen);
|
localStorage.setItem("listen", this.listen);
|
||||||
|
@ -379,9 +379,17 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await this.fetchJson(this.apiUrl() + "/sponsors/" + this.getVideoId(), {
|
const sponsors = await this.fetchJson(this.apiUrl() + "/sponsors/" + this.getVideoId(), {
|
||||||
category: JSON.stringify(selectedSkip),
|
category: JSON.stringify(selectedSkip),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const minSegmentLength = Math.max(this.getPreferenceNumber("minSegmentLength", 0), 0);
|
||||||
|
sponsors.segments = sponsors.segments.filter(segment => {
|
||||||
|
const length = segment.segment[1] - segment.segment[0];
|
||||||
|
return length >= minSegmentLength;
|
||||||
|
});
|
||||||
|
|
||||||
|
return sponsors;
|
||||||
},
|
},
|
||||||
toggleComments() {
|
toggleComments() {
|
||||||
this.showComments = !this.showComments;
|
this.showComments = !this.showComments;
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"skip_highlight": "Skip Highlight",
|
"skip_highlight": "Skip Highlight",
|
||||||
"skip_filler_tangent": "Skip Filler Tangent",
|
"skip_filler_tangent": "Skip Filler Tangent",
|
||||||
"show_markers": "Show Markers on Player",
|
"show_markers": "Show Markers on Player",
|
||||||
|
"min_segment_length": "Minimum Segment Length (in seconds)",
|
||||||
"theme": "Theme",
|
"theme": "Theme",
|
||||||
"auto": "Auto",
|
"auto": "Auto",
|
||||||
"dark": "Dark",
|
"dark": "Dark",
|
||||||
|
Loading…
Reference in New Issue
Block a user