Skip to content

Commit

Permalink
Merge pull request #960 from AI4Bharat/minorchange-01
Browse files Browse the repository at this point in the history
changes for bulk regenerate VOTR
  • Loading branch information
kartikvirendrar authored Dec 19, 2024
2 parents 718a773 + 62e7af1 commit de64bb0
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions backend/voiceover/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,24 +2309,21 @@ def csv_bulk_regenerate(request):
)
continue

voice_over = VoiceOver.objects.get(pk=voiceover_obj.id)

if voice_over.translation.transcript == None:
transcription_task = Task.objects.filter(video=task_obj.video, task_type="TRANSCRIPTION_EDIT", status="COMPLETE").first()
if transcription_task is None:
errors.append(
{
"row_no": f"Task {task_id}",
"message": f"Transcription not completed yet for this VOTR task",
}
)
continue
transcription_task = Task.objects.filter(video=task_obj.video, task_type="TRANSCRIPTION_EDIT", status="COMPLETE").first()
if transcription_task is None:
errors.append(
{
"row_no": f"Task {task_id}",
"message": f"Transcription not completed yet for this VOTR task",
}
)
continue

transcript = get_transcript_id(transcription_task)
transcript_obj = Transcript.objects.get(pk=transcript.id)
translation = Translation.objects.filter(task=task_obj).first()
translation.transcript = transcript_obj
translation.save()
transcript = get_transcript_id(transcription_task)
transcript_obj = Transcript.objects.get(pk=transcript.id)
translation = Translation.objects.filter(task=task_obj).first()
translation.transcript = transcript_obj
translation.save()

if len(errors) > 0:
return Response(
Expand Down

0 comments on commit de64bb0

Please sign in to comment.