feat: make sponsored blocks skippable

This commit is contained in:
2026-10-25 21:35:46 +01:00
parent 7052fe29af
commit a604810319
7 changed files with 170 additions and 43 deletions
+9
View File
@@ -136,6 +136,15 @@ struct ConfigurationChecks {
try require(try PlayerConfiguration.load(from: sponsor) == PlayerConfiguration(sponsorBlock: enabled),
"SponsorBlock opt-in and explicit opt-out load without changing other defaults")
}
for enabled in [true, false] {
try Data("[playback]\nsponsorblock_autoskip = \(enabled)\n".utf8).write(to: sponsor)
try require(try PlayerConfiguration.load(from: sponsor) == PlayerConfiguration(sponsorBlockAutoSkip: enabled),
"sponsor autoskip loads independently without enabling network lookups")
}
for value in ["\"true\"", "1", "[]"] {
try Data("[playback]\nsponsorblock_autoskip = \(value)\n".utf8).write(to: sponsor)
try requireLoadError(at: sponsor, "non-boolean sponsor autoskip", containing: ["sponsorblock_autoskip"])
}
let miruro = root.appendingPathComponent("miruro.toml")
for (settings, video, captions) in [
("video_provider = \"new-Host_2\"", "new-Host_2", ""),