From 694ee1d67a039da03ffc2c2e8ef56f3d809fc5f1 Mon Sep 17 00:00:00 2001 From: rambros Date: Sun, 22 Mar 2026 21:53:25 +0530 Subject: [PATCH] show Local Backup Not Found --- src/core/base.py | 19 +++++-------------- src/ui/shuttle_ops.py | 7 +++++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/core/base.py b/src/core/base.py index 44640ec..ee7b56d 100644 --- a/src/core/base.py +++ b/src/core/base.py @@ -68,25 +68,16 @@ class MigrationContext: if d.is_dir(): dname = d.name.upper() if "DISCORD_BACKUP" in dname and dname.endswith(f"-{sid_str}"): - logger.info(f"Found backup directory: {d}") + logger.info(f"Found backup directory in workspace: {d}") return d - - # 2. Fallback to global search if it wasn't found in the workspace - # We use a pattern that matches the name directly to be faster than rglob("*") - pattern = f"DISCORD_BACKUP-{sid_str}" - for d in Path(".").rglob(pattern): - if d.is_dir(): - logger.info(f"Found backup directory globally: {d}") - return d - # 3. Last ditch: some backups might not have the DISCORD_BACKUP prefix in some forks/versions? - # Unlikely here, so we stick to the return - - # If not found anywhere, return the expected location inside the workspace + # If not found in the workspace, return the expected location inside the workspace + # This allows validation screens to correctly report "not found" or "invalid" new_path = base_dir / f"DISCORD_BACKUP-{sid_str}" - logger.info(f"Using lazy backup path: {new_path}") + logger.info(f"Using lazy backup path (not yet existing): {new_path}") return new_path + async def validate_all(self) -> Dict[str, Any]: """Returns connection validation status as a dictionary.""" try: diff --git a/src/ui/shuttle_ops.py b/src/ui/shuttle_ops.py index 0a1b3e2..137ca87 100644 --- a/src/ui/shuttle_ops.py +++ b/src/ui/shuttle_ops.py @@ -295,12 +295,15 @@ class OperationPane(Container): d_status = "[red]SERVER NOT SET[/red]" elif v.get("discord_timeout"): d_status = "[red]TIMEOUT[/red]" - if d_err: + elif d_err: d_status = f"[red]{d_err}[/red]" elif d_missing: d_status = f"[yellow]MISSING: {', '.join(d_missing)}[/yellow]" elif v.get("discord_token") is False: - d_status = "[red]INVALID[/red]" + if self.config.tool_mode == "backup_transfer" and self.view_mode == "shuttle": + d_status = "[yellow]Local Backup[/yellow] [red]Not Found[/red]" + else: + d_status = "[red]INVALID[/red]" else: d_status = ""