Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fix for 0 duration error #916

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions backend/voiceover/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,13 @@ def check_audio_completion(voice_over_obj):

for index, payload in enumerate(voice_over_obj.translation.payload["payload"]):
if str(index) in voice_over_obj.payload["payload"].keys():
if (get_original_duration(voice_over_obj.payload["payload"][str(index)]["start_time"], voice_over_obj.payload["payload"][str(index)]["end_time"]) < 0.1):
missing_cards.append(
{
"card_number": index + 1,
"message": "Duration is 0 for this card.",
}
)
if (
"audio" in voice_over_obj.payload["payload"][str(index)].keys()
and type(voice_over_obj.payload["payload"][str(index)]["audio"]) == dict
Expand All @@ -1157,13 +1164,6 @@ def check_audio_completion(voice_over_obj):
"message": "There is no audio present in this card.",
}
)
if (get_original_duration(voice_over_obj.payload["payload"][str(index)]["start_time"], voice_over_obj.payload["payload"][str(index)]["end_time"]) < 0.1):
missing_cards.append(
{
"card_number": index + 1,
"message": "Duration is 0 for this card.",
}
)

return missing_cards

Expand Down
Loading