Fix bug with period not separating file extension
This commit is contained in:
@@ -110,8 +110,11 @@ class FileNameFormatter:
|
||||
index = f'_{str(index)}' if index else ''
|
||||
if not resource.extension:
|
||||
raise BulkDownloaderException(f'Resource from {resource.url} has no extension')
|
||||
ending = index + resource.extension
|
||||
file_name = str(self._format_name(resource.source_submission, self.file_format_string))
|
||||
if not re.match(r'.*\.$',file_name) and not re.match(r'^\..*',resource.extension):
|
||||
ending = index + '.' + resource.extension
|
||||
else:
|
||||
ending = index + resource.extension
|
||||
|
||||
try:
|
||||
file_path = self._limit_file_name_length(file_name, ending, subfolder)
|
||||
|
||||
Reference in New Issue
Block a user