diff --git a/examples/tv_show_config.yaml b/examples/tv_show_config.yaml index 92aa80da..c21f6230 100644 --- a/examples/tv_show_config.yaml +++ b/examples/tv_show_config.yaml @@ -77,7 +77,6 @@ presets: # "season_by_year__episode_by_download_index" if you plan to delete older videos output_options: keep_files_after: "today-{download_range}" - maintain_download_archive: True # Set the duration of download_range, defaults to 2 months overrides: diff --git a/src/ytdl_sub/config/preset_options.py b/src/ytdl_sub/config/preset_options.py index d355e807..47cf2d8c 100644 --- a/src/ytdl_sub/config/preset_options.py +++ b/src/ytdl_sub/config/preset_options.py @@ -191,6 +191,8 @@ class OutputOptions(StrictDictValidator): if isinstance(value, dict): value["output_directory"] = value.get("output_directory", "placeholder") value["file_name"] = value.get("file_name", "placeholder") + # Set this to True by default in partial validate to avoid failing from keep_files + value["maintain_download_archive"] = value.get("maintain_download_archive", True) _ = cls(name, value) def __init__(self, name, value): diff --git a/tests/unit/config/test_config_file.py b/tests/unit/config/test_config_file.py index 7e465705..e83ac7f9 100644 --- a/tests/unit/config/test_config_file.py +++ b/tests/unit/config/test_config_file.py @@ -37,7 +37,7 @@ class TestConfigFilePartiallyValidatesPresets: {"nfo_tags": {"tags": {"key-1": "preset_0"}}}, {"output_directory_nfo_tags": {"nfo_root": "test"}}, {"output_options": {"file_name": "test"}}, - {"output_options": {"keep_files_after": "today", "maintain_download_archive": True}}, + {"output_options": {"keep_files_after": "today"}}, {"ytdl_options": {"format": "best"}}, {"overrides": {"a": "b"}}, ],