From 554b4ffc2625416c804a55de6d97a5f4c6270c43 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 19 Aug 2025 08:17:28 +0200 Subject: [PATCH] fix(main.py): restart video on reaching end instead of breaking loop --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 251286d..b46ea0c 100644 --- a/main.py +++ b/main.py @@ -527,7 +527,10 @@ class MediaGrader: and not self.is_seeking ): if not self.advance_frame(): - break + # Video reached the end, restart it instead of navigating + self.current_cap.set(cv2.CAP_PROP_POS_FRAMES, 0) + self.current_frame = 0 + self.load_current_frame() if key not in [ord("p")]: self.current_index += 1