Skip to content

Bulk asynchronous downloader for multiple file hosts

convert ocmpleted downlaods to set

datawhoresc3f17ad21cc8
diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.py
index f606533e7..c5d8484ff 100644
--- a/cyberdrop_dl/clients/hash_client.py
+++ b/cyberdrop_dl/clients/hash_client.py
@@ -73,7 +73,7 @@ class HashClient:
return
hashes_dict=defaultdict(lambda: defaultdict(list))
# first compare downloads to each other
- for item in self.manager.path_manager.completed_downloads:
+ for item in list(self.manager.path_manager.completed_downloads):
hash=await self.hash_item(item)
try:
size=item.stat().st_size
diff --git a/cyberdrop_dl/managers/path_manager.py b/cyberdrop_dl/managers/path_manager.py
index 0a03f4f9a..f6bd6a1ff 100644
--- a/cyberdrop_dl/managers/path_manager.py
+++ b/cyberdrop_dl/managers/path_manager.py
@@ -35,7 +35,7 @@ class PathManager:
self.unsupported_urls_log: Path = field(init=False)
self.download_error_log: Path = field(init=False)
self.scrape_error_log: Path = field(init=False)
- self._completed_downloads=[]
+ self._completed_downloads=set()
@@ -75,7 +75,7 @@ class PathManager:
self.history_db.touch(exist_ok=True)
def add_completed(self,media:MediaItem):
- self._completed_downloads.append(media.complete_file.absolute())
+ self._completed_downloads.add(media.complete_file.absolute())
@property
def completed_downloads(self):
return self._completed_downloads
\ No newline at end of file
diff --git a/cyberdrop_dl/ui/prompts/settings_global_prompts.py b/cyberdrop_dl/ui/prompts/settings_global_prompts.py
index 93069c293..d9105835c 100644
--- a/cyberdrop_dl/ui/prompts/settings_global_prompts.py
+++ b/cyberdrop_dl/ui/prompts/settings_global_prompts.py
@@ -245,6 +245,7 @@ together during deduplication process
message="Keep at least 1 new file when unduping",
long_instruction=
"""
+ File is always kept if not in hash table
If False and the current file is in the hash table, then the current file will be deleted
""",
default=manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['keep_new_download'],