From ac936d194e41d5f171b7685abad69b7165edcf58 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Mon, 20 Mar 2023 23:44:20 -0700 Subject: [PATCH] ready? --- .../downloaders/info_json/info_json_downloader.py | 4 +--- .../ytdl_additions/enhanced_download_archive.py | 11 +++++++++++ tests/unit/prebuilt_presets/test_prebuilt_presets.py | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ytdl_sub/downloaders/info_json/info_json_downloader.py b/src/ytdl_sub/downloaders/info_json/info_json_downloader.py index 1e5a7827..244a97c1 100644 --- a/src/ytdl_sub/downloaders/info_json/info_json_downloader.py +++ b/src/ytdl_sub/downloaders/info_json/info_json_downloader.py @@ -114,9 +114,7 @@ class InfoJsonDownloader(BaseDownloader[InfoJsonDownloaderOptions]): entry.uid not in self._entry_mappings or file_name not in self._entry_mappings[entry.uid].file_names ): - self._enhanced_download_archive._file_handler.delete_file_from_output_directory( - file_name - ) + self._enhanced_download_archive.delete_file_from_output_directory(file_name) def download(self, entry: Entry) -> Entry: """ diff --git a/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py b/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py index 79193a86..822de1a2 100644 --- a/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py +++ b/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py @@ -570,6 +570,17 @@ class EnhancedDownloadArchive: self.save_file_to_output_directory(file_name=self._mapping_file_name) return self + def delete_file_from_output_directory(self, file_name: str): + """ + Deletes a file from the output directory + + Parameters + ---------- + file_name + Name of the file, relative to the output directory + """ + return self._file_handler.delete_file_from_output_directory(file_name=file_name) + def save_file_to_output_directory( self, file_name: str, diff --git a/tests/unit/prebuilt_presets/test_prebuilt_presets.py b/tests/unit/prebuilt_presets/test_prebuilt_presets.py index 79986aac..a8a02da7 100644 --- a/tests/unit/prebuilt_presets/test_prebuilt_presets.py +++ b/tests/unit/prebuilt_presets/test_prebuilt_presets.py @@ -170,7 +170,6 @@ class TestPrebuiltTVShowPresets: transaction_log_summary_file_name=( f"{expected_summary_name}_reformatted_to_{reformatted_tv_show_structure_preset}.txt" ), - regenerate_transaction_log=True, ) assert_expected_downloads( output_directory=output_directory,