fix(main.py): correct key binding and add debug check for render video
This commit is contained in:
@@ -1893,7 +1893,7 @@ class VideoEditor:
|
|||||||
print(" n: Previous video")
|
print(" n: Previous video")
|
||||||
print(" Enter: Render video (overwrites if '_edited_' in name)")
|
print(" Enter: Render video (overwrites if '_edited_' in name)")
|
||||||
print(" n: Render video")
|
print(" n: Render video")
|
||||||
print(" X: Cancel render")
|
print(" x: Cancel render")
|
||||||
print(" Q/ESC: Quit")
|
print(" Q/ESC: Quit")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
@@ -2040,24 +2040,24 @@ class VideoEditor:
|
|||||||
elif key == ord("n"):
|
elif key == ord("n"):
|
||||||
if len(self.video_files) > 1:
|
if len(self.video_files) > 1:
|
||||||
self.next_video()
|
self.next_video()
|
||||||
else:
|
elif key == ord("m"):
|
||||||
directory = self.video_path.parent
|
directory = self.video_path.parent
|
||||||
base_name = self.video_path.stem
|
base_name = self.video_path.stem
|
||||||
extension = self.video_path.suffix
|
extension = self.video_path.suffix
|
||||||
|
|
||||||
# Remove any existing _edited_ suffix to get clean base name
|
# Remove any existing _edited_ suffix to get clean base name
|
||||||
clean_base = base_name.replace("_edited", "")
|
clean_base = base_name.replace("_edited", "")
|
||||||
|
|
||||||
# Find next available number
|
# Find next available number
|
||||||
counter = 1
|
counter = 1
|
||||||
while True:
|
while True:
|
||||||
new_name = f"{clean_base}_edited_{counter:05d}{extension}"
|
new_name = f"{clean_base}_edited_{counter:05d}{extension}"
|
||||||
output_path = directory / new_name
|
output_path = directory / new_name
|
||||||
if not output_path.exists():
|
if not output_path.exists():
|
||||||
break
|
break
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
success = self.render_video(str(output_path))
|
success = self.render_video(str(output_path))
|
||||||
elif key == 13: # Enter
|
elif key == 13: # Enter
|
||||||
# Only overwrite if file already contains "_edited_" in name
|
# Only overwrite if file already contains "_edited_" in name
|
||||||
print(f"DEBUG: Checking if '{self.video_path.stem}' contains '_edited_'")
|
print(f"DEBUG: Checking if '{self.video_path.stem}' contains '_edited_'")
|
||||||
|
Reference in New Issue
Block a user