From 843bd5f2dc4d351779ae3ded2bf992c01ebeed66 Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Mon, 22 Jun 2026 18:36:18 +0000 Subject: [PATCH] Fix repos listing: use depth=2 to list all repo files --- app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 871c7dc..ba2640a 100644 --- a/app.py +++ b/app.py @@ -73,9 +73,11 @@ def get_backup_log(): "entries": entries[:10] } -def list_rclone_contents(remote, path=""): +def list_rclone_contents(remote, path="", depth=1): """List contents of a rclone remote path.""" - cmd = ["rclone", "lsjson", f"{remote}:{path}", "--drive-root-folder-id", "1ey-5aABgHDtirxeJarWy0ZmeqQPVTYtm"] + cmd = ["rclone", "lsjson", f"{remote}:{path}", + "--drive-root-folder-id", "1ey-5aABgHDtirxeJarWy0ZmeqQPVTYtm", + "--max-depth", str(depth)] try: result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) if result.returncode == 0: @@ -160,7 +162,7 @@ def list_backups(backup_type): return jsonify({"error": "Unknown type"}), 400 if backup_type == "repos": - items = list_rclone_contents("gdrive", "Git/repos") + items = list_rclone_contents("gdrive", "Git/repos", depth=2) elif backup_type == "git": items = list_rclone_contents("gdrive", "Git") items = [i for i in items if "gitea-data" in i.get("Name", "")]