From c439aca9b93cc1657b334f07561a3965e82e1989 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 17 Apr 2026 08:59:47 +0200 Subject: [PATCH] feat: add S shortcut and clear scan on file change Co-Authored-By: Claude Opus 4.6 --- main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/main.py b/main.py index 6a8d653..b13e1d4 100755 --- a/main.py +++ b/main.py @@ -1812,6 +1812,7 @@ class MainWindow(QMainWindow): lambda _, idx=i - 1: self._export_subprofile(idx) ) QShortcut(QKeySequence("M"), self, context=ctx).activated.connect(self._jump_to_next_marker) + QShortcut(QKeySequence("S"), self, context=ctx).activated.connect(self._jump_to_next_scan_region) QShortcut(QKeySequence("N"), self, context=ctx).activated.connect(self._playlist.advance) QShortcut(QKeySequence("G"), self, context=ctx).activated.connect(self._btn_lock.toggle) QShortcut(QKeySequence("A"), self, context=ctx).activated.connect(self._autoclip) @@ -1841,6 +1842,7 @@ class MainWindow(QMainWindow): "EExport" "1–9Export to subprofile 1–9" "MJump to next marker" + "SJump to next scan region" "NNext file in playlist" "GToggle cursor lock" "AAutoclip — fit clip count to pause position" @@ -2027,6 +2029,11 @@ class MainWindow(QMainWindow): self._btn_lock.setChecked(False) self._crop_keyframes.clear() self._timeline.set_crop_keyframes([]) + self._timeline.clear_scan_regions() + if self._scan_worker and self._scan_worker.isRunning(): + self._scan_worker.cancel() + self._cleanup_scan_worker() + self._btn_scan.setEnabled(True) dur = self._mpv.get_duration() self._timeline.set_duration(dur) @@ -2572,6 +2579,17 @@ class MainWindow(QMainWindow): self._btn_scan.setEnabled(True) self._show_status(f"Scan error: {msg}") + def _jump_to_next_scan_region(self) -> None: + regions = sorted(self._timeline._scan_regions, key=lambda r: r[0]) + if not regions: + return + for (start, _end, _score) in regions: + if start > self._cursor + 0.1: + self._step_cursor(start - self._cursor) + return + # Wrap to first region + self._step_cursor(regions[0][0] - self._cursor) + # --- Export --- def _pick_folder(self):