Skip to content

Commit

Permalink
Merge pull request #1075 from AI4Bharat/revised-rejected
Browse files Browse the repository at this point in the history
added fix for text not getting changed, fix for save call not working…
  • Loading branch information
aparna-aa authored Jul 9, 2024
2 parents f0bbad1 + d85448f commit 867edc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ const AudioTranscriptionLandingPage = ({project_type}) => {

useEffect(() => {
let standardisedTranscription = "";

const sub = annotations[0]?.result.filter((item) => {
if ("standardised_transcription" in item) {
standardisedTranscription = item.standardised_transcription;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/Sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default class Sub {
this.audio_speed = obj.audio_speed;
this.speaker_id = obj.speaker_id;
this.acoustic_normalised_text = obj.acoustic_normalised_text ?? "";
this.acoustic_standardized_text = obj.acoustic_standardized_text ? obj.acoustic_standardized_text : this.acoustic_normalised_text;
if (obj.acoustic_standardized_text) {
this.acoustic_standardized_text = obj.acoustic_standardized_text;
}
}

get check() {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/SubTitlesUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const addSubtitleBox = (index, stage, updatedProjectData) => {
speaker_id: "",
target_text: "",
acoustic_normalised_text: "",
acoustic_standardized_text: "",
...(stage === 3 && {acoustic_standardized_text: ""})
})
);
console.log(copySub)
Expand Down Expand Up @@ -241,7 +241,7 @@ export const onSubtitleChange = (text, index, updateAcoustic, populateAcoustic,
console.log(copySub)
const sub = copySub[index];
console.log(sub);
if (updateAcoustic === 1)
if (updateAcoustic === 1 || updateAcoustic === true)
sub.acoustic_normalised_text = text;

else if (populateAcoustic) {
Expand All @@ -251,7 +251,7 @@ console.log(sub);
else if(updateAcoustic === 2)
sub.acoustic_standardized_text = text;

else if(updateAcoustic === 0)
else if(updateAcoustic === 0 || updateAcoustic === false)
sub.text = text;


Expand Down

0 comments on commit 867edc2

Please sign in to comment.