From 832e0542d61ec35ac583ddb99ea92196b898266f Mon Sep 17 00:00:00 2001 From: Kartik Virendra Rajput <88619994+kartikvirendrar@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:34:16 +0530 Subject: [PATCH] Revert "changes for export filename" --- src/containers/Organization/OrgLevelTaskList.jsx | 8 ++++---- src/containers/Organization/Project/TaskList.jsx | 8 ++++---- .../Organization/Video/VoiceOverRightPanel1.jsx | 8 ++++---- src/utils/subtitleUtils.js | 6 ++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/containers/Organization/OrgLevelTaskList.jsx b/src/containers/Organization/OrgLevelTaskList.jsx index bd8af889..cb008df6 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(); - const filename = res.headers.get('content-type'); - exportFile(resp, currentTaskDetails, transcript, "transcription", filename); + + exportFile(resp, currentTaskDetails, transcript, "transcription"); } else { const resp = await res.json(); @@ -486,8 +486,8 @@ const OrgLevelTaskList = () => { if (res.ok) { const resp = await res.blob(); - const filename = res.headers.get('content-type'); - exportFile(resp, currentTaskDetails, translate, "translation", filename); + + exportFile(resp, currentTaskDetails, translate, "translation"); } else { const resp = await res.json(); diff --git a/src/containers/Organization/Project/TaskList.jsx b/src/containers/Organization/Project/TaskList.jsx index e077e00d..c08a3672 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(); - const filename = res.headers.get('content-type'); - exportFile(resp, currentTaskDetails, transcript, "transcription", filename); + + exportFile(resp, currentTaskDetails, transcript, "transcription"); } else { const resp = await res.json(); @@ -575,8 +575,8 @@ const TaskList = () => { if (res.ok) { const resp = await res.blob(); - const filename = res.headers.get('content-type'); - exportFile(resp, currentTaskDetails, translate, "translation", filename); + + exportFile(resp, currentTaskDetails, translate, "translation"); } else { const resp = await res.json(); diff --git a/src/containers/Organization/Video/VoiceOverRightPanel1.jsx b/src/containers/Organization/Video/VoiceOverRightPanel1.jsx index bfb745f7..3fafc7ef 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(); - const filename = res.headers.get('content-type'); - exportFile(resp, taskData, transcript, "transcription", filename); + + exportFile(resp, taskData, transcript, "transcription"); } else { const resp = await res.json(); @@ -828,8 +828,8 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg if (res.ok) { const resp = await res.blob(); - const filename = res.headers.get('content-type'); - exportFile(resp, taskData, translate, "translation", filename); + + exportFile(resp, taskData, translate, "translation"); } else { const resp = await res.json(); diff --git a/src/utils/subtitleUtils.js b/src/utils/subtitleUtils.js index 5d431d57..b434e1e6 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, filename) => { +export const exportFile = (data, taskDetails, exportType, type) => { const { video: videoId, src_language: sourceLanguage, @@ -740,9 +740,7 @@ export const exportFile = (data, taskDetails, exportType, type, filename) => { let fileName = ""; if (specialOrgIds.includes(userOrgId) && description.length) { fileName = `${description}.${format}`; - }else if(filename.length){ - fileName = `${filename}.${format}`; - }else { + } else { fileName = `Chitralekha_Video${videoId}_${YYYYMMDD}_${HHMMSS}_${language}.${format}`; }