[HOTFIX] Fix StringFormattingException regarding keep_max_files (#1427)
Closes this issue from last release: https://github.com/jmbannon/ytdl-sub/issues/1426
This commit is contained in:
parent
a097c6a476
commit
d37945db7e
2 changed files with 4 additions and 4 deletions
|
|
@ -155,8 +155,8 @@ class SubscriptionDownload(BaseSubscription, ABC):
|
||||||
keep_max_files: Optional[int] = None
|
keep_max_files: Optional[int] = None
|
||||||
if self.output_options.keep_max_files:
|
if self.output_options.keep_max_files:
|
||||||
# validated it can be cast to int within the validator
|
# validated it can be cast to int within the validator
|
||||||
keep_max_files = int(
|
keep_max_files = self.overrides.apply_formatter(
|
||||||
self.overrides.apply_formatter(self.output_options.keep_max_files)
|
self.output_options.keep_max_files, expected_type=int
|
||||||
)
|
)
|
||||||
|
|
||||||
if date_range_to_keep or self.output_options.keep_max_files is not None:
|
if date_range_to_keep or self.output_options.keep_max_files is not None:
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@ class SubscriptionYTDLOptions:
|
||||||
self._enhanced_download_archive.working_ytdl_file_path
|
self._enhanced_download_archive.working_ytdl_file_path
|
||||||
)
|
)
|
||||||
if self._preset.output_options.keep_max_files:
|
if self._preset.output_options.keep_max_files:
|
||||||
keep_max_files = int(
|
keep_max_files = self._overrides.apply_formatter(
|
||||||
self._overrides.apply_formatter(self._preset.output_options.keep_max_files)
|
self._preset.output_options.keep_max_files, expected_type=int
|
||||||
)
|
)
|
||||||
if keep_max_files > 0:
|
if keep_max_files > 0:
|
||||||
# yt-dlp has a weird bug with max_downloads=1, set to 2 for safe measure
|
# yt-dlp has a weird bug with max_downloads=1, set to 2 for safe measure
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue