diff --git a/backend/app.py b/backend/app.py index 1d04826..17f282e 100644 --- a/backend/app.py +++ b/backend/app.py @@ -145,12 +145,18 @@ def list_sessions(): continue archives = {".7z", ".zip", ".rar", ".tar.gz", ".tgz", ".tar", ".gz", ".bz2", ".xz", ".ova"} has_source = has_disks or any(f["name"].lower().endswith(tuple(archives)) for f in session_files) + resume_file = session_files[0]["name"] + for f in session_files: + if f["name"].lower().endswith(tuple(archives)) or f["name"].lower().endswith((".vmdk", ".qcow2", ".vdi")): + resume_file = f["name"] + break sessions.append({ "session_id": entry.name, "files": session_files[:10], "total_size_gb": round(total_bytes / (1024**3), 1), "has_disks": has_disks, "resumable": has_source, + "resume_file": resume_file, }) except Exception: pass diff --git a/backend/converter.py b/backend/converter.py index b536b5e..1932e62 100644 --- a/backend/converter.py +++ b/backend/converter.py @@ -52,7 +52,18 @@ def extract_if_needed(filename: str) -> Path: if not filepath.is_absolute(): filepath = STAGING_ROOT / filename if not filepath.exists(): - raise FileNotFoundError(f"Source not found: {filepath}") + # Try finding by name — walk the parent directory + parent = filepath.parent + fname = filepath.name + if parent.exists() and parent.is_dir(): + found = list(parent.rglob(fname)) + if found: + filepath = found[0] + logger.info("Found by name: %s", filepath) + else: + raise FileNotFoundError(f"Source not found: {filepath}") + else: + raise FileNotFoundError(f"Source not found: {filepath}") # Detect archive type name = filepath.name.lower() diff --git a/frontend/templates/index.html b/frontend/templates/index.html index 585f903..8a15d98 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -91,13 +91,13 @@ async function loadSessions() { for (var i = 0; i < sessions.length; i++) { var s = sessions[i]; var fileNames = s.files.map(function(f) { return f.name; }).join(', '); - var firstFile = s.files[0].name; + var resumeFile = s.resume_file || s.files[0].name; html += '