Browse Source

Avoid dividing by zero

doc-issue-template
MrS0m30n3 8 years ago
parent
commit
444a42e7b0
1 changed files with 4 additions and 1 deletions
  1. 5
      youtube_dl_gui/mainframe.py

5
youtube_dl_gui/mainframe.py

@ -431,8 +431,11 @@ class MainFrame(wx.Frame):
# REFACTOR Store percentage as float in the DownloadItem? # REFACTOR Store percentage as float in the DownloadItem?
# REFACTOR DownloadList keep track for each item stage? # REFACTOR DownloadList keep track for each item stage?
items_count = active + completed + error + queued
total_percentage += completed * 100.0 + error * 100.0 total_percentage += completed * 100.0 + error * 100.0
total_percentage /= active + completed + error + queued
if items_count:
total_percentage /= items_count
msg = self.URL_REPORT_MSG.format(total_percentage, queued, paused, active, completed, error) msg = self.URL_REPORT_MSG.format(total_percentage, queued, paused, active, completed, error)

Loading…
Cancel
Save