Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Run configs alphabetically, and output config name on summary and dow…
Browse files Browse the repository at this point in the history
…nload screen
  • Loading branch information
Jules-WinnfieldX committed May 29, 2024
1 parent dfb6c14 commit 7822285
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.3.19"
__version__ = "5.3.21"
4 changes: 2 additions & 2 deletions cyberdrop_dl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def director(manager: Manager) -> None:
if len(logger.handlers) > 0:
await log("Picking new config...", 20)

configs_to_run = list(set(configs) - set(configs_ran))
configs_to_run = list(set(configs) - set(configs_ran)).sort()
manager.config_manager.change_config(configs_to_run[0])
configs_ran.append(configs_to_run[0])
if len(logger.handlers) > 0:
Expand Down Expand Up @@ -119,7 +119,7 @@ async def director(manager: Manager) -> None:
clear_screen_proc = await asyncio.create_subprocess_shell('cls' if os.name == 'nt' else 'clear')
await clear_screen_proc.wait()

await log("Running Post-Download Processes...", 20)
await log(f"Running Post-Download Processes For Config: {manager.config_manager.loaded_config}...", 20)
if isinstance(manager.args_manager.sort_downloads, bool):
if manager.args_manager.sort_downloads:
sorter = Sorter(manager)
Expand Down
3 changes: 2 additions & 1 deletion cyberdrop_dl/managers/progress_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
class ProgressManager:
def __init__(self, manager: 'Manager'):
# File Download Bars
self.manager = manager
self.file_progress: FileProgress = FileProgress(manager.config_manager.global_settings_data['UI_Options']['downloading_item_limit'], manager)

# Scraping Printout
self.scraping_progress: ScrapingProgress = ScrapingProgress(manager.config_manager.global_settings_data['UI_Options']['scraping_item_limit'], manager)

# Overall Progress Bars & Stats
self.download_progress: DownloadsProgress = DownloadsProgress()
self.download_progress: DownloadsProgress = DownloadsProgress(manager)
self.download_stats_progress: DownloadStatsProgress = DownloadStatsProgress()
self.scrape_stats_progress: ScrapeStatsProgress = ScrapeStatsProgress()

Expand Down
10 changes: 7 additions & 3 deletions cyberdrop_dl/ui/progress/downloads_progress.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from typing import Tuple
from typing import Tuple, TYPE_CHECKING

from rich.console import Group
from rich.panel import Panel
from rich.progress import Progress, BarColumn

if TYPE_CHECKING:
from cyberdrop_dl.managers.manager import Manager


class DownloadsProgress:
"""Class that keeps track of completed, skipped and failed files"""

def __init__(self):
def __init__(self, manager: 'Manager'):
self.manager = manager
self.progress = Progress("[progress.description]{task.description}",
BarColumn(bar_width=None),
"[progress.percentage]{task.percentage:>3.2f}%",
Expand All @@ -27,7 +31,7 @@ def __init__(self):

async def get_progress(self) -> Panel:
"""Returns the progress bar"""
return Panel(self.progress_group, title="Files", border_style="green", padding=(1, 1))
return Panel(self.progress_group, title=f"Config: {self.manager.config_manager.loaded_config}", border_style="green", padding=(1, 1))

async def update_total(self) -> None:
"""Updates the total number of files to be downloaded"""
Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.3.19"
version = "5.3.21"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ python = "^3.11"
aiohttp = "^3.9.1"
aiolimiter = "^1.1.0"
inquirerpy = "^0.3.4"
platformdirs = "^4.2.0"
platformdirs = "^4.2.2"
rich = "^13.7.0"
pyyaml = "^6.0.1"
certifi = "^2024.2.2"
Expand Down

0 comments on commit 7822285

Please sign in to comment.