Skip to content

Bulk asynchronous downloader for multiple file hosts

rename option and add count missing as existing

datawhores9c15aa98209a
diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.py
index 21ca5f469..5c00d4704 100644
--- a/cyberdrop_dl/clients/hash_client.py
+++ b/cyberdrop_dl/clients/hash_client.py
@@ -84,7 +84,7 @@ class HashClient:
# matches=list(filter(lambda x:x!=path and x.exists(),all_matches))
# if len(matches)==0:
# continue
- # elif self.manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_current_download']:
+ # elif self.manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_prev_download']:
# for ele in matches:
# ele.unlink(missing_ok=True)
# else:
diff --git a/cyberdrop_dl/managers/config_manager.py b/cyberdrop_dl/managers/config_manager.py
index 54eb97877..ca38666a3 100644
--- a/cyberdrop_dl/managers/config_manager.py
+++ b/cyberdrop_dl/managers/config_manager.py
@@ -170,8 +170,10 @@ class ConfigManager:
self.global_settings_data['Dupe_Cleanup_Options']['delete_after_download']
self.global_settings_data['Dupe_Cleanup_Options']['hash_while_downloading'] = \
self.global_settings_data['Dupe_Cleanup_Options']['hash_while_downloading']
- self.global_settings_data['Dupe_Cleanup_Options']['keep_current_download'] = \
- self.global_settings_data['Dupe_Cleanup_Options']['keep_current_download']
+ self.global_settings_data['Dupe_Cleanup_Options']['keep_prev_download'] = \
+ self.global_settings_data['Dupe_Cleanup_Options']['keep_prev_download']
+ self.global_settings_data['Dupe_Cleanup_Options']['count_missing_as_existing'] = \
+ self.global_settings_data['Dupe_Cleanup_Options']['count_missing_as_existing']
self.global_settings_data['UI_Options']['refresh_rate'] = int(
diff --git a/cyberdrop_dl/ui/prompts/settings_global_prompts.py b/cyberdrop_dl/ui/prompts/settings_global_prompts.py
index 1b141b9f5..300d55a1c 100644
--- a/cyberdrop_dl/ui/prompts/settings_global_prompts.py
+++ b/cyberdrop_dl/ui/prompts/settings_global_prompts.py
@@ -229,12 +229,30 @@ def edit_dupe_settings_prompt(manager: Manager) -> None:
vi_mode=manager.vi_mode,
).execute()
keep_current = inquirer.select(
- message="Keep one current download:",
- default=manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_current_download'],
+ message="Which files to prioritize:",
+ long_instruction=
+ """
+ If True, keep the existing file (previous download) and skip the new download
+ If False, keep the new download and potentially overwrite the existing file"
+ """,
+ default=manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_prev_download'],
+ choices=[Choice(True,"True"),Choice(False,"False")],
+ vi_mode=manager.vi_mode,
+ ).execute()
+
+
+ count_missing_files = inquirer.select(
+ message="Count moved files as existing",
+ long_instruction=
+ """
+ consider a missing/moved file as an existing
+ """,
+ default=manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['count_missing_as_existing'],
choices=[Choice(True,"True"),Choice(False,"False")],
vi_mode=manager.vi_mode,
).execute()
manager.config_manager.global_settings_data['Dupe_Cleanup_Options'][' delete_after_download'] = delete_after
manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['hash_while_downloading'] = hash_while_downloading
- manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_current_download'] = keep_current
\ No newline at end of file
+ manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_prev_download'] = keep_current
+ manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['count_missing_as_existing'] = count_missing_files
\ No newline at end of file
diff --git a/cyberdrop_dl/utils/args/config_definitions.py b/cyberdrop_dl/utils/args/config_definitions.py
index 407577162..dc32d7cb3 100644
--- a/cyberdrop_dl/utils/args/config_definitions.py
+++ b/cyberdrop_dl/utils/args/config_definitions.py
@@ -137,7 +137,8 @@ global_settings: Dict = {
{
"delete_after_download": False,
"hash_while_downloading": False,
- "keep_current_download": False
+ "keep_prev_download": False,
+ "count_missing_as_existing": False
},
"UI_Options": {