feat: show optional SponsorBlock ranges on playback timeline
This commit is contained in:
@@ -130,6 +130,12 @@ struct ConfigurationChecks {
|
||||
"built-in defaults hide buffer info, disable automatic quality, and enable snapping")
|
||||
try require(defaults.miruroVideoProvider.isEmpty && defaults.miruroCaptionProvider.isEmpty,
|
||||
"Miruro defaults select automatic video and captions independently")
|
||||
let sponsor = root.appendingPathComponent("sponsorblock.toml")
|
||||
for enabled in [true, false] {
|
||||
try Data("[playback]\nsponsorblock = \(enabled)\n".utf8).write(to: sponsor)
|
||||
try require(try PlayerConfiguration.load(from: sponsor) == PlayerConfiguration(sponsorBlock: enabled),
|
||||
"SponsorBlock opt-in and explicit opt-out load without changing other defaults")
|
||||
}
|
||||
let miruro = root.appendingPathComponent("miruro.toml")
|
||||
for (settings, video, captions) in [
|
||||
("video_provider = \"new-Host_2\"", "new-Host_2", ""),
|
||||
@@ -178,13 +184,15 @@ struct ConfigurationChecks {
|
||||
# Sections and nested keys can be quoted, with comments and whitespace.
|
||||
['playback']
|
||||
'automatic_quality' = true
|
||||
'sponsorblock' = true
|
||||
[ui]
|
||||
"buffer_info" = true # session display default
|
||||
compact_snap_to_edges = false
|
||||
""".utf8)
|
||||
try original.write(to: config)
|
||||
try files.setAttributes([.posixPermissions: 0o444], ofItemAtPath: config.path)
|
||||
let configured = PlayerConfiguration(showBufferInfo: true, automaticQuality: true, snapToEdges: false)
|
||||
let configured = PlayerConfiguration(showBufferInfo: true, automaticQuality: true, sponsorBlock: true,
|
||||
snapToEdges: false)
|
||||
let environment = ["XDG_CONFIG_HOME": xdg.path]
|
||||
try require(try PlayerConfiguration.load(from: config) == configured,
|
||||
"TOML comments, whitespace, quoted nested keys, and both boolean values load from a read-only file")
|
||||
@@ -192,6 +200,7 @@ struct ConfigurationChecks {
|
||||
try require(session == configured, "application startup automatically loads the XDG config")
|
||||
session.showBufferInfo = false
|
||||
session.automaticQuality = false
|
||||
session.sponsorBlock = false
|
||||
session.snapToEdges = true
|
||||
try require(session == defaults, "controls can override all settings within the session")
|
||||
try require(try Data(contentsOf: config) == original, "loading and session overrides do not change config bytes")
|
||||
@@ -267,6 +276,10 @@ struct ConfigurationChecks {
|
||||
("ui-legacy", "[ui]\nshow_buffer_info = true\n", ["ui.show_buffer_info"]),
|
||||
("string", "[ui]\nbuffer_info = \"true\"\n", []),
|
||||
("integer", "[playback]\nautomatic_quality = 1\n", []),
|
||||
("sponsor-string", "[playback]\nsponsorblock = \"true\"\n", ["sponsorblock"]),
|
||||
("sponsor-integer", "[playback]\nsponsorblock = 1\n", ["sponsorblock"]),
|
||||
("sponsor-array", "[playback]\nsponsorblock = [true]\n", ["sponsorblock"]),
|
||||
("sponsor-table", "[playback.sponsorblock]\nenabled = true\n", ["sponsorblock"]),
|
||||
("array", "[ui]\ncompact_snap_to_edges = [true]\n", []),
|
||||
("progress-value", "[ui]\ncompact_title_progress = \"unknown\"\n", ["compact_title_progress", "unknown"]),
|
||||
("progress-bool", "[ui]\ncompact_title_progress = false\n", ["compact_title_progress"]),
|
||||
|
||||
Reference in New Issue
Block a user