feat: configure duration-aware progress in compact titles

This commit is contained in:
2026-10-12 15:45:22 +02:00
parent 1f5e9541e7
commit 35fa89e492
5 changed files with 96 additions and 8 deletions
+8
View File
@@ -116,6 +116,12 @@ struct ConfigurationChecks {
"printed TOML is directly usable and preserves all default behavior and bindings")
try require(!defaults.showBufferInfo && !defaults.automaticQuality && defaults.snapToEdges,
"built-in defaults hide buffer info, disable automatic quality, and enable snapping")
for (value, expected) in [("time", CompactTitleProgress.time), ("percentage", .percentage), ("none", .none)] {
let progress = root.appendingPathComponent("compact-progress-\(value).toml")
try Data("[ui]\ncompact_title_progress = \"\(value)\"\n".utf8).write(to: progress)
try require(try PlayerConfiguration.load(from: progress).compactTitleProgress == expected,
"compact title format \(value) loads from a partial UI section")
}
try require(PlayerConfiguration.fileURL(environment: ["XDG_CONFIG_HOME": xdg.path], homeDirectory: home) == config,
"absolute XDG_CONFIG_HOME selects terebi/config.toml")
for environment in [[:], ["XDG_CONFIG_HOME": ""], ["XDG_CONFIG_HOME": "relative/config"]] {
@@ -219,6 +225,8 @@ struct ConfigurationChecks {
("string", "[ui]\nbuffer_info = \"true\"\n", []),
("integer", "[playback]\nautomatic_quality = 1\n", []),
("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"]),
("table", "[playback.automatic_quality]\nenabled = true\n", ["automatic_quality"]),
("ui-scalar", "ui = true\n", ["ui"]),
("keys-scalar", "keys = true\n", ["keys"]),