Skip to content

Bulk asynchronous downloader for multiple file hosts

fix final log also only mark downloads from current run and not just all downloads from database

datawhoresf796fc78594f
diff --git a/cyberdrop_dl/clients/download_client.py b/cyberdrop_dl/clients/download_client.py
index b2c8b2cec..96e34a2de 100644
--- a/cyberdrop_dl/clients/download_client.py
+++ b/cyberdrop_dl/clients/download_client.py
@@ -170,6 +170,8 @@ class DownloadClient:
if downloaded:
media_item.partial_file.rename(media_item.complete_file)
await self.mark_completed(media_item, domain)
+ #only mark add path if actually downloaded this run
+ self.manager.path_manager.add_completed(media_item)
self.file_path=media_item
return downloaded
@@ -190,7 +192,6 @@ class DownloadClient:
async def _handle_media_item_completion(self, media_item) -> None:
try:
"""Handle hashing completed items and adds item to the completed list"""
- self.manager.path_manager.add_completed(media_item)
if self.manager.config_manager.global_settings_data['Dupe_Cleanup_Options']['hash_while_downloading']:
await self._hash_client.hash_item(media_item.complete_file)
except Exception as e:
diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.py
index 399732fe0..2f3c91188 100644
--- a/cyberdrop_dl/clients/hash_client.py
+++ b/cyberdrop_dl/clients/hash_client.py
@@ -61,7 +61,7 @@ class HashClient:
size=item.stat().st_size
if hash:
hashes_dict[hash][size].append(item)
-
+
with self.manager.live_manager.get_remove_file_via_hash_live() :
# #remove downloaded files, so each group only has the first downloaded file
for size_dict in hashes_dict.values():
@@ -76,10 +76,10 @@ class HashClient:
await self.manager.progress_manager.hash_progress.add_removed_file()
if selected_file:
- size_dict[size] = {'selected': selected_file, 'others': list(map(lambda x:str(x),files))}
+ size_dict[size] = {'selected': selected_file, 'others': list(map(lambda x:str(x.absolute()),files))}
else:
del size_dict[size]
-
+
for hash, size_dict in hashes_dict.items():
for size, data in size_dict.items():
selected_file = data['selected']
diff --git a/cyberdrop_dl/managers/progress_manager.py b/cyberdrop_dl/managers/progress_manager.py
index c0dae6f7f..4caffe314 100644
--- a/cyberdrop_dl/managers/progress_manager.py
+++ b/cyberdrop_dl/managers/progress_manager.py
@@ -73,8 +73,8 @@ class ProgressManager:
await log_with_color("\nDupe Stats:", "cyan", 20)
await log_with_color(f"Previously Hashed {self.hash_progress.prev_hash_files} files", "yellow", 20)
await log_with_color(f"Newly Hashed {self.hash_progress.hashed_files} files", "yellow", 20)
- await log_with_color(f"Removed From Downloads{self.hash_progress.removed_files} files", "yellow", 20)
- await log_with_color(f"Removed From Previous Downloads{self.hash_progress.removed_prev_files} files", "yellow", 20)
+ await log_with_color(f"Removed From Downloads {self.hash_progress.removed_files} files", "yellow", 20)
+ await log_with_color(f"Removed From Previous Downloads {self.hash_progress.removed_prev_files} files", "yellow", 20)