Skip to content

Commit

Permalink
add error message for 0 duration
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikvirendrar committed Sep 18, 2024
1 parent 34dc0bf commit 3822898
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/voiceover/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,11 +1136,16 @@ def save_voice_over(request):
text = voice_over_payload["text"]
if text == "" or len(text) == 0:
return Response(
{"message": "Text can't be empty."},
{"message": "Text can't be empty for segment "+str(index+1)},
status=status.HTTP_400_BAD_REQUEST,
)

original_duration = get_original_duration(start_time, end_time)
if original_duration < 0.5:
return Response(
{"message": "Duration can't be 0 for segment "+str(index+1)},
status=status.HTTP_400_BAD_REQUEST,
)

if (
voice_over.voice_over_type == "MACHINE_GENERATED"
Expand Down

0 comments on commit 3822898

Please sign in to comment.