Skip to content

Commit 35b97e1

Browse files
committed
process_ffmpeg.py: Added text 'try:⏎except FileNotFoundError:⏎return None'; Moved 5 lines
1 parent 13dc1bb commit 35b97e1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

library/mediafiles/process_ffmpeg.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,14 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
496496
if video_stream and args.audio_only and not args.no_preserve_video:
497497
delete_larger = False
498498

499-
if delete_transcode:
500-
output_path.unlink()
501-
return str(path)
502-
elif delete_larger:
503-
path.unlink()
499+
try:
500+
if delete_transcode:
501+
output_path.unlink()
502+
return str(path)
503+
elif delete_larger:
504+
path.unlink()
505+
except FileNotFoundError:
506+
return None
504507

505508
os.utime(output_path, (original_stats.st_atime, original_stats.st_mtime))
506509
return str(output_path)

0 commit comments

Comments
 (0)