Commit 4c9d5d11 authored by Thomas Bernhart's avatar Thomas Bernhart
Browse files

Do not duplicate file extension separator on media export

parent 79e2d539
......@@ -22,7 +22,7 @@ def _normalize_document_id(document_id):
def _normalize_file_extension(original_file_name):
file_ext_mapping = {
"jpg": "jpeg"
".jpg": ".jpeg"
}
ext = path.splitext(original_file_name)[1]
......@@ -104,12 +104,11 @@ def media_export(record_set_path, datastreamstore_path, http_files_path, rtmp_fi
accesscopy_file = media_file_searcher.search_media_file()
if accesscopy_file is not None:
_copy_file(accesscopy_file[0], path.join(record_set_path, "media"),
_normalize_document_id(document_id) + "." + _normalize_file_extension(accesscopy_file[1]), logger)
_normalize_document_id(document_id) + _normalize_file_extension(accesscopy_file[1]), logger)
thumbnail_file = media_file_searcher.search_thumbnail_file()
if thumbnail_file is not None:
original_file_ext = path.splitext(accesscopy_file[1])[1]
_copy_file(thumbnail_file[0], path.join(record_set_path, "thumbnails"),
_normalize_document_id(document_id) + "." + _normalize_file_extension(thumbnail_file[1]), logger)
_normalize_document_id(document_id) + _normalize_file_extension(thumbnail_file[1]), logger)
print("Finished media export")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment