feat(config): add rename_chapters field, CLI flag, and 3-layer resolution

Add rename_chapters boolean config field following the established
pattern from download_extras/download_covers. Config defaults to
True; YAML supports explicit false; --rename-chapters CLI flag forces
True overriding config. Threaded through sync_run() with resolved value
ready for pipeline wiring in slice 3.

Closes #33
This commit is contained in:
AlexKucera committed 2026-06-05 17:15:16 +02:00
1 parent b6df4e3a9b
commit af5ad4953c
11 files changed
+175 -2

No files matched your search

+14
View File
@@ -173,6 +173,13 @@ class TestDefaults:
)
assert config.download_covers is True
def test_default_rename_chapters_is_true(self):
config = load_config(
config_path=FIXTURES / "config_minimal.yaml",
secrets_path=FIXTURES / "secrets_only_creds.yaml",
)
assert config.rename_chapters is True
class TestWorkersDefault:
"""workers field defaults to 3 when not specified in YAML."""
@@ -273,6 +280,13 @@ class TestEdgeCases:
)
assert config.download_covers is False
def test_explicit_false_for_rename_chapters(self):
config = load_config(
config_path=FIXTURES / "config_with_overrides.yaml",
secrets_path=FIXTURES / "secrets_only_creds.yaml",
)
assert config.rename_chapters is False
def test_all_three_valid_formats_accepted(self):
for fmt in ("m4b_mp3_fallback", "mp3_only", "m4b_only"):
config = load_config(