fix keep_files_after error in partial validate

This commit is contained in:
Jesse Bannon 2022-10-25 23:34:35 -07:00
parent 24c4917bf5
commit d72c222f9e
3 changed files with 3 additions and 2 deletions

View file

@ -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:

View file

@ -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):

View file

@ -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"}},
],