Skip to content

Commit 901fb86

Browse files
committed
[HOTFIX] Fix StringFormattingException regarding keep_max_files
1 parent a097c6a commit 901fb86

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/ytdl_sub/subscriptions/subscription_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def _maintain_archive_file(self):
155155
keep_max_files: Optional[int] = None
156156
if self.output_options.keep_max_files:
157157
# validated it can be cast to int within the validator
158-
keep_max_files = int(
159-
self.overrides.apply_formatter(self.output_options.keep_max_files)
158+
keep_max_files = self.overrides.apply_formatter(
159+
self.output_options.keep_max_files, expected_type=int
160160
)
161161

162162
if date_range_to_keep or self.output_options.keep_max_files is not None:

src/ytdl_sub/subscriptions/subscription_ytdl_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def _output_options(self) -> Dict:
9494
self._enhanced_download_archive.working_ytdl_file_path
9595
)
9696
if self._preset.output_options.keep_max_files:
97-
keep_max_files = int(
98-
self._overrides.apply_formatter(self._preset.output_options.keep_max_files)
97+
keep_max_files = self._overrides.apply_formatter(
98+
self._preset.output_options.keep_max_files, expected_type=int
9999
)
100100
if keep_max_files > 0:
101101
# yt-dlp has a weird bug with max_downloads=1, set to 2 for safe measure

0 commit comments

Comments
 (0)