mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-19 20:51:28 +02:00
Add option to disable showing full video segments
This commit is contained in:
parent
d16a409db2
commit
57de51475f
4 changed files with 35 additions and 1 deletions
|
@ -624,6 +624,10 @@
|
|||
"muteSegments": {
|
||||
"message": "Allow segments that mute audio instead of skip"
|
||||
},
|
||||
"fullVideoSegments": {
|
||||
"message": "Show an icon when a video is entirely an advertisement",
|
||||
"description": "Referring to the category pill that is now shown on videos that are entirely sponsor or entirely selfpromo"
|
||||
},
|
||||
"colorFormatIncorrect": {
|
||||
"message": "Your color is formatted incorrectly. It should be a 3 or 6 digit hex code with a number sign at the beginning."
|
||||
},
|
||||
|
|
|
@ -66,6 +66,22 @@
|
|||
<br/>
|
||||
</div>
|
||||
|
||||
<div option-type="toggle" sync-option="fullVideoSegments">
|
||||
<label class="switch-container">
|
||||
<label class="switch">
|
||||
<input type="checkbox" checked>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<div class="switch-label">
|
||||
__MSG_fullVideoSegments__
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ interface SBConfig {
|
|||
showTimeWithSkips: boolean,
|
||||
disableSkipping: boolean,
|
||||
muteSegments: boolean,
|
||||
fullVideoSegments: boolean,
|
||||
trackViewCount: boolean,
|
||||
trackViewCountInPrivate: boolean,
|
||||
dontShowNotice: boolean,
|
||||
|
@ -177,6 +178,7 @@ const Config: SBObject = {
|
|||
showTimeWithSkips: true,
|
||||
disableSkipping: false,
|
||||
muteSegments: true,
|
||||
fullVideoSegments: true,
|
||||
trackViewCount: true,
|
||||
trackViewCountInPrivate: true,
|
||||
dontShowNotice: false,
|
||||
|
|
|
@ -687,7 +687,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
|
|||
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
|
||||
const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
||||
categories,
|
||||
actionTypes: Config.config.muteSegments ? [ActionType.Skip, ActionType.Mute, ActionType.Full] : [ActionType.Skip, ActionType.Full],
|
||||
actionTypes: getEnabledActionTypes(),
|
||||
userAgent: `${chrome.runtime.id}`,
|
||||
...extraRequestData
|
||||
});
|
||||
|
@ -768,6 +768,18 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
|
|||
lookupVipInformation(id);
|
||||
}
|
||||
|
||||
function getEnabledActionTypes(): ActionType[] {
|
||||
const actionTypes = [ActionType.Skip];
|
||||
if (Config.config.muteSegments) {
|
||||
actionTypes.push(ActionType.Mute);
|
||||
}
|
||||
if (Config.config.fullVideoSegments) {
|
||||
actionTypes.push(ActionType.Full);
|
||||
}
|
||||
|
||||
return actionTypes;
|
||||
}
|
||||
|
||||
function lookupVipInformation(id: string): void {
|
||||
updateVipInfo().then((isVip) => {
|
||||
if (isVip) {
|
||||
|
|
Loading…
Reference in a new issue