diff --git a/src/containers/Organization/OrgLevelTaskList.jsx b/src/containers/Organization/OrgLevelTaskList.jsx index cb008df6..bd8af889 100644 --- a/src/containers/Organization/OrgLevelTaskList.jsx +++ b/src/containers/Organization/OrgLevelTaskList.jsx @@ -445,8 +445,8 @@ const OrgLevelTaskList = () => { if (res.ok) { const resp = await res.blob(); - - exportFile(resp, currentTaskDetails, transcript, "transcription"); + const filename = res.headers.get('content-type'); + exportFile(resp, currentTaskDetails, transcript, "transcription", filename); } else { const resp = await res.json(); @@ -486,8 +486,8 @@ const OrgLevelTaskList = () => { if (res.ok) { const resp = await res.blob(); - - exportFile(resp, currentTaskDetails, translate, "translation"); + const filename = res.headers.get('content-type'); + exportFile(resp, currentTaskDetails, translate, "translation", filename); } else { const resp = await res.json(); diff --git a/src/containers/Organization/Project/TaskList.jsx b/src/containers/Organization/Project/TaskList.jsx index c08a3672..e077e00d 100644 --- a/src/containers/Organization/Project/TaskList.jsx +++ b/src/containers/Organization/Project/TaskList.jsx @@ -534,8 +534,8 @@ const TaskList = () => { if (res.ok) { const resp = await res.blob(); - - exportFile(resp, currentTaskDetails, transcript, "transcription"); + const filename = res.headers.get('content-type'); + exportFile(resp, currentTaskDetails, transcript, "transcription", filename); } else { const resp = await res.json(); @@ -575,8 +575,8 @@ const TaskList = () => { if (res.ok) { const resp = await res.blob(); - - exportFile(resp, currentTaskDetails, translate, "translation"); + const filename = res.headers.get('content-type'); + exportFile(resp, currentTaskDetails, translate, "translation", filename); } else { const resp = await res.json(); diff --git a/src/containers/Organization/Video/VoiceOverRightPanel1.jsx b/src/containers/Organization/Video/VoiceOverRightPanel1.jsx index 3fafc7ef..bfb745f7 100644 --- a/src/containers/Organization/Video/VoiceOverRightPanel1.jsx +++ b/src/containers/Organization/Video/VoiceOverRightPanel1.jsx @@ -789,8 +789,8 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg if (res.ok) { const resp = await res.blob(); - - exportFile(resp, taskData, transcript, "transcription"); + const filename = res.headers.get('content-type'); + exportFile(resp, taskData, transcript, "transcription", filename); } else { const resp = await res.json(); @@ -828,8 +828,8 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg if (res.ok) { const resp = await res.blob(); - - exportFile(resp, taskData, translate, "translation"); + const filename = res.headers.get('content-type'); + exportFile(resp, taskData, translate, "translation", filename); } else { const resp = await res.json(); diff --git a/src/utils/subtitleUtils.js b/src/utils/subtitleUtils.js index b434e1e6..5d431d57 100644 --- a/src/utils/subtitleUtils.js +++ b/src/utils/subtitleUtils.js @@ -704,7 +704,7 @@ export const exportVoiceover = (data, taskDetails, exportTypes) => { } }; -export const exportFile = (data, taskDetails, exportType, type) => { +export const exportFile = (data, taskDetails, exportType, type, filename) => { const { video: videoId, src_language: sourceLanguage, @@ -740,7 +740,9 @@ export const exportFile = (data, taskDetails, exportType, type) => { let fileName = ""; if (specialOrgIds.includes(userOrgId) && description.length) { fileName = `${description}.${format}`; - } else { + }else if(filename.length){ + fileName = `${filename}.${format}`; + }else { fileName = `Chitralekha_Video${videoId}_${YYYYMMDD}_${HHMMSS}_${language}.${format}`; }