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

Commit

Permalink
add change url and download on base ui because people are stupid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 4, 2023
1 parent 7419f46 commit cd29cc4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 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.0.21"
__version__ = "5.0.22"
9 changes: 5 additions & 4 deletions cyberdrop_dl/ui/prompts/general_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def main_prompt(manager: Manager) -> int:
Choice(4, "Edit URLs File"),
Separator(),
Choice(5, f"Select Config (Current: {manager.config_manager.loaded_config})"),
Choice(6, "Manage Configs"),
Choice(6, "Change URLs.txt file and Download Location"),
Choice(7, "Manage Configs"),
Separator(),
Choice(7, "Import Cyberdrop_V4 Items"),
Choice(8, "Donate"),
Choice(9, "Exit"),
Choice(8, "Import Cyberdrop_V4 Items"),
Choice(9, "Donate"),
Choice(10, "Exit"),
], long_instruction="ARROW KEYS: Navigate | ENTER: Select",
).execute()

Expand Down
27 changes: 23 additions & 4 deletions cyberdrop_dl/ui/ui.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING

from InquirerPy import inquirer
from InquirerPy.validator import PathValidator
from rich.console import Console

from cyberdrop_dl import __version__
Expand Down Expand Up @@ -53,8 +55,25 @@ def program_ui(manager: Manager):
selected_config = select_config_prompt(configs)
manager.config_manager.change_config(selected_config)

# Manage Configs
elif action == 6:
console.clear()
console.print("Editing Input / Output File Paths")
input_file = inquirer.filepath(
message="Enter the input file path:",
default=str(manager.config_manager.settings_data['Files']['input_file']),
validate=PathValidator(is_file=True, message="Input is not a file")
).execute()
download_folder = inquirer.text(
message="Enter the download folder path:",
default=str(manager.config_manager.settings_data['Files']['download_folder']),
validate=PathValidator(is_dir=True, message="Input is not a directory")
).execute()

manager.config_manager.settings_data['Files']['input_file'] = Path(input_file)
manager.config_manager.settings_data['Files']['download_folder'] = Path(download_folder)

# Manage Configs
elif action == 7:
while True:
console.clear()
console.print("[bold]Manage Configs[/bold]")
Expand Down Expand Up @@ -107,13 +126,13 @@ def program_ui(manager: Manager):
break

# Import Cyberdrop_V4 Items
elif action == 7:
elif action == 8:
import_cyberdrop_v4_items_prompt(manager)

# Donate
elif action == 8:
elif action == 9:
donations_prompt()

# Exit
elif action == 9:
elif action == 10:
exit(0)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.0.21"
version = "5.0.22"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit cd29cc4

Please sign in to comment.