Fix division by 0
This commit is contained in:
parent
79746c5bc6
commit
f2002f9077
@ -226,9 +226,13 @@ class Core(CorePluginBase):
|
|||||||
def download_blocklist_thread(self, callback, load):
|
def download_blocklist_thread(self, callback, load):
|
||||||
"""Downloads the blocklist specified by 'url' in the config"""
|
"""Downloads the blocklist specified by 'url' in the config"""
|
||||||
def on_retrieve_data(count, block_size, total_blocks):
|
def on_retrieve_data(count, block_size, total_blocks):
|
||||||
fp = float(count * block_size) / total_blocks
|
if total_blocks:
|
||||||
if fp > 1.0:
|
fp = float(count * block_size) / total_blocks
|
||||||
fp = 1.0
|
if fp > 1.0:
|
||||||
|
fp = 1.0
|
||||||
|
else:
|
||||||
|
fp = 0.0
|
||||||
|
|
||||||
self.file_progress = fp
|
self.file_progress = fp
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user