Skip to content

Commit

Permalink
Merge pull request #3088 from ferdnyc/export-extension
Browse files Browse the repository at this point in the history
Export: Don't double file extensions
  • Loading branch information
ferdnyc authored Nov 25, 2019
2 parents 2ad1854 + 9c802f4 commit 211eed6
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 211eed6

Please sign in to comment.