Skip to content

Commit 54eae8e

Browse files
committed
Fixed: os.path.exists() does not run for --file mode
1 parent 7074382 commit 54eae8e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

transcode.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def map_options(self):
115115
if args.preset:
116116
self.encoder_preset = args.preset.lower()
117117
else:
118-
self.encoder_preset = "Slow"
118+
self.encoder_preset = "slow"
119119
if args.quality:
120120
self.encoder_quality = args.quality
121121
if args.small:
@@ -185,17 +185,16 @@ def cleanup(self):
185185
extensions = [".mp4", ".m4v", ".mov", ".mkv", ".mpg", ".mpeg", ".avi", ".wmv", ".flv", ".webm", ".ts"]
186186
if args.all:
187187
source_files = ["source/" + file for file in os.listdir("source") if os.path.splitext(file)[1].lower() in extensions]
188-
print(source_files)
189-
for source_file in source_files:
188+
else:
189+
source_files = [args.file]
190+
for source_file in source_files:
190191
session = Session(source_file)
191192
if os.path.exists(session.path["output"]):
192193
print("Skipping", source_file)
193194
source_files = [file for file in source_files if file is not source_file]
194195
print(source_files)
195196
if len(source_files) == 0:
196197
sys.exit("All source files have already been transcoded. Exiting.")
197-
else:
198-
source_files = [args.file]
199198
if not os.path.exists("performance"):
200199
os.mkdir("performance")
201200
if not os.path.exists("hevc"):

0 commit comments

Comments
 (0)