fix keep_files_after error in partial validate
This commit is contained in:
parent
24c4917bf5
commit
d72c222f9e
3 changed files with 3 additions and 2 deletions
|
|
@ -77,7 +77,6 @@ presets:
|
||||||
# "season_by_year__episode_by_download_index" if you plan to delete older videos
|
# "season_by_year__episode_by_download_index" if you plan to delete older videos
|
||||||
output_options:
|
output_options:
|
||||||
keep_files_after: "today-{download_range}"
|
keep_files_after: "today-{download_range}"
|
||||||
maintain_download_archive: True
|
|
||||||
|
|
||||||
# Set the duration of download_range, defaults to 2 months
|
# Set the duration of download_range, defaults to 2 months
|
||||||
overrides:
|
overrides:
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,8 @@ class OutputOptions(StrictDictValidator):
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
value["output_directory"] = value.get("output_directory", "placeholder")
|
value["output_directory"] = value.get("output_directory", "placeholder")
|
||||||
value["file_name"] = value.get("file_name", "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)
|
_ = cls(name, value)
|
||||||
|
|
||||||
def __init__(self, name, value):
|
def __init__(self, name, value):
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class TestConfigFilePartiallyValidatesPresets:
|
||||||
{"nfo_tags": {"tags": {"key-1": "preset_0"}}},
|
{"nfo_tags": {"tags": {"key-1": "preset_0"}}},
|
||||||
{"output_directory_nfo_tags": {"nfo_root": "test"}},
|
{"output_directory_nfo_tags": {"nfo_root": "test"}},
|
||||||
{"output_options": {"file_name": "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"}},
|
{"ytdl_options": {"format": "best"}},
|
||||||
{"overrides": {"a": "b"}},
|
{"overrides": {"a": "b"}},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue