mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
Add option to manual skip when a full video segment exists
This commit is contained in:
@@ -463,6 +463,12 @@
|
|||||||
"minDurationDescription": {
|
"minDurationDescription": {
|
||||||
"message": "Segments shorter than the set value will not be skipped or show in the player."
|
"message": "Segments shorter than the set value will not be skipped or show in the player."
|
||||||
},
|
},
|
||||||
|
"enableManualSkipOnFullVideo": {
|
||||||
|
"message": "Use manual skip when a full video label exists"
|
||||||
|
},
|
||||||
|
"whatManualSkipOnFullVideo": {
|
||||||
|
"message": "For people who want to watch the video uninteruppted if it is fully sponsored or self promotion."
|
||||||
|
},
|
||||||
"skipNoticeDuration": {
|
"skipNoticeDuration": {
|
||||||
"message": "Skip notice duration (seconds):"
|
"message": "Skip notice duration (seconds):"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -98,6 +98,20 @@
|
|||||||
|
|
||||||
<div class="small-description">__MSG_minDurationDescription__</div>
|
<div class="small-description">__MSG_minDurationDescription__</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-type="toggle" data-sync="manualSkipOnFullVideo">
|
||||||
|
<div class="switch-container">
|
||||||
|
<label class="switch">
|
||||||
|
<input id="manualSkipOnFullVideo" type="checkbox" checked>
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label class="switch-label" for="manualSkipOnFullVideo">
|
||||||
|
__MSG_enableManualSkipOnFullVideo__
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-description">__MSG_whatManualSkipOnFullVideo__</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-type="toggle" data-sync="forceChannelCheck">
|
<div data-type="toggle" data-sync="forceChannelCheck">
|
||||||
<div class="switch-container">
|
<div class="switch-container">
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ interface SBConfig {
|
|||||||
disableSkipping: boolean,
|
disableSkipping: boolean,
|
||||||
muteSegments: boolean,
|
muteSegments: boolean,
|
||||||
fullVideoSegments: boolean,
|
fullVideoSegments: boolean,
|
||||||
|
manualSkipOnFullVideo: boolean,
|
||||||
trackViewCount: boolean,
|
trackViewCount: boolean,
|
||||||
trackViewCountInPrivate: boolean,
|
trackViewCountInPrivate: boolean,
|
||||||
trackDownvotes: boolean,
|
trackDownvotes: boolean,
|
||||||
@@ -159,6 +160,7 @@ const Config: SBObject = {
|
|||||||
disableSkipping: false,
|
disableSkipping: false,
|
||||||
muteSegments: true,
|
muteSegments: true,
|
||||||
fullVideoSegments: true,
|
fullVideoSegments: true,
|
||||||
|
manualSkipOnFullVideo: false,
|
||||||
trackViewCount: true,
|
trackViewCount: true,
|
||||||
trackViewCountInPrivate: true,
|
trackViewCountInPrivate: true,
|
||||||
trackDownvotes: true,
|
trackDownvotes: true,
|
||||||
|
|||||||
@@ -1690,9 +1690,10 @@ function createButton(baseID: string, title: string, callback: () => void, image
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shouldAutoSkip(segment: SponsorTime): boolean {
|
function shouldAutoSkip(segment: SponsorTime): boolean {
|
||||||
return utils.getCategorySelection(segment.category)?.option === CategorySkipOption.AutoSkip ||
|
return (!Config.config.manualSkipOnFullVideo || !sponsorTimes?.some((s) => s.category === segment.category && s.actionType === ActionType.Full))
|
||||||
|
&& (utils.getCategorySelection(segment.category)?.option === CategorySkipOption.AutoSkip ||
|
||||||
(Config.config.autoSkipOnMusicVideos && sponsorTimes?.some((s) => s.category === "music_offtopic")
|
(Config.config.autoSkipOnMusicVideos && sponsorTimes?.some((s) => s.category === "music_offtopic")
|
||||||
&& segment.actionType !== ActionType.Poi);
|
&& segment.actionType !== ActionType.Poi));
|
||||||
}
|
}
|
||||||
|
|
||||||
function shouldSkip(segment: SponsorTime): boolean {
|
function shouldSkip(segment: SponsorTime): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user