Skip to content

Bulk asynchronous downloader for multiple file hosts

move sorting stats

datawhores930b523dd2ea
diff --cc cyberdrop_dl/managers/progress_manager.py
index fdd3f0316,ee7416249..c79050aa3
--- a/cyberdrop_dl/managers/progress_manager.py
+++ b/cyberdrop_dl/managers/progress_manager.py
@@@ -82,6 -82,6 +82,12 @@@ class ProgressManager
await log_with_color(f"Newly Hashed {self.hash_progress.hashed_files} files", "yellow", 20)
await log_with_color(f"Removed From Current 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("\nSort Stats:", "cyan", 20)
++ await log_with_color(f"Organized: {self.sort_progress.audio_count} Audios", "green", 20)
++ await log_with_color(f"Organized: {self.sort_progress.image_count} Images", "green", 20)
++ await log_with_color(f"Organized: {self.sort_progress.video_count} Videos", "green", 20)
++ await log_with_color(f"Organized: {self.sort_progress.other_count} Other Files", "green", 20)
diff --cc cyberdrop_dl/utils/sorting.py
index 32c0ee872,009c652ed..d64f43be4
--- a/cyberdrop_dl/utils/sorting.py
+++ b/cyberdrop_dl/utils/sorting.py
@@@ -114,17 -118,22 +118,19 @@@ class Sorter
await self.sort_video(file, folder.name)
else:
await self.sort_other(file, folder.name)
+ await self.manager.progress_manager.sort_progress.advance_folder(task_id, 1) # advance folder progress by one file
await purge_dir_tree(folder)
- await self.manager.progress_manager.sort_progress.add_sorted_dir()
+ queue_length -= 1
+ await self.manager.progress_manager.sort_progress.set_queue_length(queue_length) # update queue length
+ await self.manager.progress_manager.sort_progress.remove_folder(task_id) # remove folder from progress
- await asyncio.sleep(5)
+ await asyncio.sleep(1)
await purge_dir_tree(self.download_dir)
+ clear_screen_proc = await asyncio.create_subprocess_shell('cls' if os_name == 'nt' else 'clear')
+ await clear_screen_proc.wait()
+
- await log_with_color(f"Organized: {self.audio_count} Audios", "green", 20)
- await log_with_color(f"Organized: {self.image_count} Images", "green", 20)
- await log_with_color(f"Organized: {self.video_count} Videos", "green", 20)
- await log_with_color(f"Organized: {self.other_count} Other Files", "green", 20)
+
- await log_with_color(f"Organized: {self.audio_count} Audio Files", "green", 20)
- await log_with_color(f"Organized: {self.image_count} Image Files", "green", 20)
- await log_with_color(f"Organized: {self.video_count} Video Files", "green", 20)
- await log_with_color(f"Organized: {self.other_count} Other Files", "green", 20)
async def get_download_folder(self):
"""Gets the download folder"""