show Local Backup Not Found
This commit is contained in:
parent
185afb1ee0
commit
694ee1d67a
2 changed files with 10 additions and 16 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -295,11 +295,14 @@ 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:
|
||||
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 = ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue