diff --git a/src/ui/pages/container/CL-Transcription/SubtitleBoxes.jsx b/src/ui/pages/container/CL-Transcription/SubtitleBoxes.jsx index 9404b8318..74b081dfe 100644 --- a/src/ui/pages/container/CL-Transcription/SubtitleBoxes.jsx +++ b/src/ui/pages/container/CL-Transcription/SubtitleBoxes.jsx @@ -58,7 +58,7 @@ import React, { let isDroging = false; export default memo( - function ({ render, currentTime }) { + function ({ render, currentTime, duration }) { const { taskId } = useParams(); const classes = AudioTranscriptionLandingStyle(); const dispatch = useDispatch(); @@ -141,54 +141,11 @@ import React, { // // eslint-disable-next-line // }, [result, currentIndex, isPlaying(player)]); - const saveTranscript = async (taskType, result) => { - const reqBody = { - task_id: taskId, - annotation_status: taskData?.annotation_status, - result, - ...(( !AnnotationStage||SuperCheckerStage) && { - parent_annotation: taskData?.parent_annotation, - }), - }; - if (!textBox && !speakerBox) { - const obj = new SaveTranscriptAPI(taskData?.id,reqBody); - const res = await fetch(obj.apiEndPoint(), { - method: "PATCH", - body: JSON.stringify(obj.getBody()), - headers: obj.getHeaders().headers, - }); - - const resp = await res.json(); - if (!res.ok) { - setSnackbarInfo({ - open: true, - message: "Error in autosaving annotation", - variant: "error", - }); - } - }{ - if (textBox) { - setSnackbarInfo({ - open: true, - message: "Please Enter All The Transcripts", - variant: "error", - }); - } else if(speakerBox){ - setSnackbarInfo({ - open: true, - message: "Please Select The Speaker", - variant: "error", - }); - } - } - }; - const removeSub = useCallback( (sub) => { const index = hasSub(sub); const res = onSubtitleDelete(index); dispatch(setSubtitles(res, C.SUBTITLES)); - //saveTranscript(taskData?.annotation_status, res); }, // eslint-disable-next-line [result] @@ -199,7 +156,6 @@ import React, { const index = hasSub(sub); const res = onMerge(index); dispatch(setSubtitles(res, C.SUBTITLES)); - //saveTranscript(taskData?.annotation_status, res); }, // eslint-disable-next-line [result] @@ -216,7 +172,6 @@ import React, { copySub[index] = sub; dispatch(setSubtitles(copySub, C.SUBTITLES)); - //saveTranscript(taskData?.annotation_status,copySub); }, // eslint-disable-next-line [result] @@ -281,13 +236,13 @@ import React, { } } else if (lastType === "right") { if (endTime >= 0 && endTime - lastSub.startTime >= 0.2) { - const end_time = DT.d2t(endTime); + const end_time = DT.d2t(Math.min(endTime, duration)); if (index >= 0 && index !== result.length - 1 && endTime <= DT.t2d(next.start_time)) { updateSub(lastSub, { end_time }); } - - if(index === result.length - 1 && endTime < lastSub.endTime) { + + if(index === result.length - 1) { updateSub(lastSub, { end_time }); } } else { diff --git a/src/ui/pages/container/CL-Transcription/TimeLine.jsx b/src/ui/pages/container/CL-Transcription/TimeLine.jsx index eddbb11a0..399368f52 100644 --- a/src/ui/pages/container/CL-Transcription/TimeLine.jsx +++ b/src/ui/pages/container/CL-Transcription/TimeLine.jsx @@ -328,6 +328,7 @@ console.log(taskID,"taskDatataskData") render={render} playing={playing} currentTime={currentTime} + duration={player.duration} /> )} diff --git a/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx b/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx index 9f9946618..4b9c4029e 100644 --- a/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx +++ b/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx @@ -507,7 +507,7 @@ const TranscriptionRightPanel = ({ - Acoustic Transcription + Semantic (L2) Transcription }