Skip to content

Commit 0a4d569

Browse files
authored
add config option video.enable_sponsorblock to disable sponsorblock globally (#1344)
add config option to disable sponsorblock globally
1 parent 0274f95 commit 0a4d569

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

server/ott-config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,13 @@ export const conf = convict({
442442
default: true,
443443
},
444444
},
445+
video: {
446+
enable_sponsorblock: {
447+
doc: "Whether to enable fetching skipable segments from sponsorblock.",
448+
format: Boolean,
449+
default: true,
450+
},
451+
},
445452
});
446453

447454
function getExtraBaseConfig(): string | undefined {

server/room.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,11 @@ export class Room implements RoomState {
540540
this.currentSource = null;
541541
}
542542

543-
if (this.autoSkipSegmentCategories.length > 0 && this.currentSource) {
543+
if (
544+
conf.get("video.enable_sponsorblock") &&
545+
this.autoSkipSegmentCategories.length > 0 &&
546+
this.currentSource
547+
) {
544548
this.wantSponsorBlock = true;
545549
}
546550
if (!this.currentSource && this.videoSegments.length > 0) {
@@ -762,7 +766,7 @@ export class Room implements RoomState {
762766
);
763767
}
764768

765-
if (this.autoSkipSegmentCategories.length > 0) {
769+
if (conf.get("video.enable_sponsorblock") && this.autoSkipSegmentCategories.length > 0) {
766770
if (this.wantSponsorBlock) {
767771
this.wantSponsorBlock = false; // Disable this before the request to avoid spamming the sponsorblock if the request takes too long.
768772
try {

0 commit comments

Comments
 (0)