add to only recent ppreset

This commit is contained in:
Jesse Bannon 2023-11-17 00:54:03 -08:00
parent dc60f26fb1
commit 15bd84279a
2 changed files with 9 additions and 6 deletions

View file

@ -411,9 +411,9 @@ class OutputOptions(StrictDictValidator):
"""
Optional. Requires ``maintain_download_archive`` set to True.
Only keeps N most recently uploaded videos. Can be used in conjunction with
``keep_files_before`` and ``keep_files_after``.
Only keeps N most recently uploaded videos. If set to <= 0, ``keep_max_files`` will not be
applied. Can be used in conjunction with ``keep_files_before`` and ``keep_files_after``.
"""
if self._keep_max_files:
if self._keep_max_files and self._keep_max_files.value > 0:
return self._keep_max_files.value
return None

View file

@ -22,12 +22,15 @@ presets:
"Only Recent":
# Only fetch videos after today minus date_range
date_range:
after: "today-{date_range}"
after: "today-{only_recent_date_range}"
# Only keep files uploaded after date_range
output_options:
keep_files_after: "today-{date_range}"
keep_files_after: "today-{only_recent_date_range}"
keep_files_max: "{only_recent_max_files}"
# Set the default date_range to 2 months
overrides:
date_range: "2months"
date_range: "2months"
only_recent_date_range: "{date_range}"
only_recent_max_files: 0