Skip to content

Commit

Permalink
Export: Don't double file extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Nov 20, 2019
1 parent ad1df9e commit 9c802f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/windows/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,15 @@ def accept(self):
# Determine final exported file path (and replace blank paths with default ones)
default_filename = "Untitled Project"
default_folder = os.path.join(info.HOME_PATH)
if export_type != _("Image Sequence"):
file_name_with_ext = "%s.%s" % (self.txtFileName.text().strip() or default_filename, self.txtVideoFormat.text().strip())
else:
if export_type == _("Image Sequence"):
file_name_with_ext = "%s%s" % (self.txtFileName.text().strip() or default_filename, self.txtImageFormat.text().strip())
else:
file_ext = self.txtVideoFormat.text().strip()
file_name_with_ext = self.txtFileName.text().strip() or default_filename
# Append extension, if not already present
if not file_name_with_ext.endswith(file_ext):
file_name_with_ext = '{}.{}'.format(file_name_with_ext, file_ext)

export_file_path = os.path.join(self.txtExportFolder.text().strip() or default_folder, file_name_with_ext)
log.info("Export path: %s" % export_file_path)

Expand Down

0 comments on commit 9c802f4

Please sign in to comment.