Skip to content

Commit 03cb5ee

Browse files
committed
Modified process_ffmpeg.py, web.py
1 parent 6c7e08c commit 03cb5ee

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

library/mediafiles/process_ffmpeg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
9090
except processes.UnplayableFile:
9191
if args.delete_unplayable:
9292
log.warning("Deleting unplayable (ffprobe): %s", path)
93-
path.unlink()
93+
path.unlink(missing_ok=True)
9494
return None
9595
raise
9696

9797
if not probe.streams:
9898
log.error("No media streams found: %s", path)
9999
if args.delete_unplayable:
100100
log.warning("Deleting unplayable (no streams): %s", path)
101-
path.unlink()
101+
path.unlink(missing_ok=True)
102102
return None
103103
return str(path)
104104

@@ -107,7 +107,7 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
107107
if is_animation is None:
108108
if args.delete_unplayable:
109109
log.warning("Deleting unplayable (zero frames): %s", path)
110-
path.unlink()
110+
path.unlink(missing_ok=True)
111111
return None
112112
return str(path)
113113
elif not is_animation:
@@ -119,7 +119,7 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
119119
album_art_stream = next((s for s in probe.album_art_streams), None)
120120
if not video_stream:
121121
if args.delete_no_video:
122-
path.unlink()
122+
path.unlink(missing_ok=True)
123123
return None
124124
if args.video_only:
125125
return str(path)
@@ -129,7 +129,7 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
129129

130130
if not audio_stream:
131131
if args.delete_no_audio:
132-
path.unlink()
132+
path.unlink(missing_ok=True)
133133
return None
134134
if args.audio_only:
135135
return str(path)
@@ -276,7 +276,7 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
276276
except AssertionError:
277277
log.exception("Broken file or audio format misdetected: %s", path)
278278
if args.delete_no_audio:
279-
path.unlink()
279+
path.unlink(missing_ok=True)
280280
return None
281281
else:
282282
if channels == 1:
@@ -498,10 +498,10 @@ def process_path(args, path, include_timecode=False, **kwargs) -> str | None:
498498

499499
try:
500500
if delete_transcode:
501-
output_path.unlink()
501+
output_path.unlink(missing_ok=True)
502502
return str(path)
503503
elif delete_larger:
504-
path.unlink()
504+
path.unlink(missing_ok=True)
505505
except FileNotFoundError:
506506
return None
507507

library/utils/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ def exists(self, *, follow_symlinks=True):
10791079
return False
10801080
return True
10811081

1082-
def unlink(self):
1082+
def unlink(self, *args, **kwargs):
10831083
pass
10841084

10851085
def as_posix(self) -> str:

0 commit comments

Comments
 (0)