fix: open the copy browser at a zip in downloads

This commit is contained in:
Abdessamad Derraz committed 2026-10-26 21:19:26 +01:00
1 parent ae3faec86b
commit ad60a88deb
2 files changed
+32

No files matched your search

+13
View File
@@ -11347,10 +11347,23 @@ def _open_from_browser(state: TuiState) -> list[tuple]:
state.browse_for = "from"
_push(state, "browse")
start = state.from_folders[-1].parent if state.from_folders else state.home
downloads = state.home / "Downloads"
if not state.from_folders and _is_dir(downloads) and any(
name.lower().endswith(".zip") for name in _listed(downloads)):
# A pack or a backup ZIP is most often there: 18 presses from the
# first screen reached it through HOME, past every mounted drive.
start = downloads
_browse_to(state, _nearest_folder(start))
return []
def _listed(folder: Path) -> list[str]:
try:
return os.listdir(folder)
except OSError:
return []
def _toggle_region(state: TuiState, name: str) -> None:
if name in state.regions:
state.regions.remove(name)