Skip to content

Commit

Permalink
Handle edge case where postprocess goes above 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenshin9977 committed Aug 18, 2022
1 parent 7c5c102 commit b5cb125
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ffmpeg_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ def _get_progress_percent(timestamp: str, total_duration: int) -> int:
progress_seconds = sum(
[factor * time for factor, time in zip(prog, timestamps_factors)]
)
return int(progress_seconds / total_duration * 100)
progress_percent = int(progress_seconds / total_duration * 100)
return 99 if progress_percent > 100 else progress_percent

0 comments on commit b5cb125

Please sign in to comment.