From 16c841d14dc3aec2a81f8ffbc352bd2dc55a2263 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 26 Sep 2025 19:39:59 +0200 Subject: [PATCH] Remove some retard --- croppa/main.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/croppa/main.py b/croppa/main.py index a50e759..e21e6a5 100644 --- a/croppa/main.py +++ b/croppa/main.py @@ -2408,22 +2408,8 @@ class VideoEditor: if not self.templates: return False - # Find template with start_frame > current_frame - current_frame = self.current_frame - template_to_remove = None - - for i, (start_frame, region, template_image) in enumerate(self.templates): - if start_frame > current_frame: - # Found template with start_frame > current_frame - # Remove the previous one (if it exists) - if i > 0: - template_to_remove = i - 1 - break - elif start_frame == current_frame: - # Found template with start_frame == current_frame - # Remove THIS template - template_to_remove = i - break + # Use the existing function to find the template to remove + template_to_remove = self.get_template_for_frame(self.current_frame) if template_to_remove is not None: removed_template = self.templates.pop(template_to_remove)