Fixed error when output folder does not exist.

This commit is contained in:
Thomasedv 2021-04-16 19:45:53 +02:00
parent cf8e2b856a
commit 9992414053

View file

@ -138,6 +138,8 @@ class Project(object):
# Check for non-empty string
if isinstance(self.output_file, str) and self.output_file:
if self.output_file[-1] in ('\\', '/'):
if not Path(self.output_file).exists():
os.makedirs(Path(self.output_file), exist_ok=True)
self.output_file = Path(f"{self.output_file}{self.input.stem}_{self.encoder}{suffix}")
else:
self.output_file = Path(f"{self.input.stem}_{self.encoder}{suffix}")