dry-run actually dry running
This commit is contained in:
parent
72af21745d
commit
dd1e6d4dd6
3 changed files with 25 additions and 1 deletions
|
|
@ -236,6 +236,8 @@ class Subscription:
|
|||
If true, do not download any video/audio files or move anything to the output
|
||||
directory.
|
||||
"""
|
||||
self._enhanced_download_archive.reinitialize(dry_run=dry_run)
|
||||
|
||||
# TODO: Move this logic to separate function
|
||||
# TODO: set id here as well
|
||||
ytdl_options = copy.deepcopy(self.ytdl_options.dict)
|
||||
|
|
|
|||
|
|
@ -350,6 +350,28 @@ class EnhancedDownloadArchive:
|
|||
|
||||
self._logger = Logger.get(name=subscription_name)
|
||||
|
||||
def reinitialize(self, dry_run: bool) -> "EnhancedDownloadArchive":
|
||||
"""
|
||||
Re-initialize the enhanced download archive for successive downloads w/the same
|
||||
subscription.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
dry_run
|
||||
Whether to actually move files to the output directory
|
||||
|
||||
Returns
|
||||
-------
|
||||
self
|
||||
"""
|
||||
self._file_handler = FileHandler(
|
||||
working_directory=self.working_directory,
|
||||
output_directory=self.output_directory,
|
||||
dry_run=dry_run,
|
||||
)
|
||||
self._download_mapping = DownloadMappings()
|
||||
return self
|
||||
|
||||
@property
|
||||
def archive_file_name(self) -> str:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -151,5 +151,5 @@ class TestPlaylistAsKodiMusicVideo:
|
|||
def test_single_video_download(
|
||||
self, single_video_subscription, expected_single_video_download, output_directory
|
||||
):
|
||||
single_video_subscription.download()
|
||||
single_video_subscription.download(dry_run=True)
|
||||
expected_single_video_download.assert_files_exist(relative_directory=output_directory)
|
||||
|
|
|
|||
Loading…
Reference in a new issue