From 22e2ad27a0c37433a308fc6d3ea376b71f2b9d86 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 12 Apr 2026 00:41:41 +0200 Subject: [PATCH] fix: show one marker per batch, not one per sub-clip Pending marker uses cursor position for the whole batch. DB markers deduplicated by start_time since all sub-clips share the same cursor. Co-Authored-By: Claude Sonnet 4.6 --- main.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 7f3b359..f92f481 100755 --- a/main.py +++ b/main.py @@ -309,7 +309,14 @@ class ProcessedDB: " WHERE filename = ? ORDER BY start_time", (match,), ).fetchall() - return [(t, i + 1, p) for i, (t, p) in enumerate(rows)] + # Deduplicate by start_time — batch exports share the same cursor. + seen_times: dict[float, tuple[float, int, str]] = {} + n = 0 + for t, p in rows: + if t not in seen_times: + n += 1 + seen_times[t] = (t, n, p) + return list(seen_times.values()) def get_markers(self, filename: str) -> list[tuple[float, int, str]]: """Return [(start_time, marker_number, output_path), ...] for the best @@ -1820,10 +1827,10 @@ class MainWindow(QMainWindow): self._btn_export.setEnabled(False) self.statusBar().showMessage(f"Exporting {len(jobs)} clip(s)…") - # Show pending markers immediately. + # Show one pending marker at the cursor position for the whole batch. + first_out = jobs[0][1] pending = list(self._timeline._markers) - for start, out, _, _ in jobs: - pending.append((start, self._export_counter, out)) + pending.append((self._cursor, self._export_counter, first_out)) self._timeline.set_markers(pending) self._export_worker = ExportWorker(