From ed33b9a9b91fc0c32a0b74f933c608dfe871263a Mon Sep 17 00:00:00 2001 From: Luna Midori Date: Sun, 12 Jan 2025 03:27:32 -0800 Subject: [PATCH] fun --- Webserver/Programs/Downloader/helper_app.py | 2 +- Webserver/Programs/File_manager/file_manager.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Webserver/Programs/Downloader/helper_app.py b/Webserver/Programs/Downloader/helper_app.py index 0e2ac9f..895bf1f 100644 --- a/Webserver/Programs/Downloader/helper_app.py +++ b/Webserver/Programs/Downloader/helper_app.py @@ -49,7 +49,7 @@ def get_api_key(): api_key = f.read() break - if attempt_count > 1: + if attempt_count > 0: print("Login failed, please try again manually") print("API KEY not set, please log into Midori AI's Servers") print("Run ``midori_ai_login -u \"username\"``") diff --git a/Webserver/Programs/File_manager/file_manager.py b/Webserver/Programs/File_manager/file_manager.py index 77a0d67..4cb5db3 100644 --- a/Webserver/Programs/File_manager/file_manager.py +++ b/Webserver/Programs/File_manager/file_manager.py @@ -97,9 +97,6 @@ def confirm(text="Are you sure?"): else: print("Invalid input. Please enter 'y' or 'n'.") - - - def walk_directory(directory: pathlib.Path, tree: Tree) -> None: """Recursively build a Tree with directory contents.""" # Sort dirs first then by filename @@ -265,7 +262,7 @@ def unpack_tar(tar_file, dst_dir): spinner.succeed(text=f"Done moving files to {dst_dir}") spinner.start(text=f"Cleaning up temporary folder: {temp_workfolder}") - os.rmdir(temp_workfolder) + remove_directory_recursively(temp_workfolder, spinner) spinner.succeed(text=f"Done cleaning up temporary folder: {temp_workfolder}") def upload_to_midori_ai(data: bytes):