mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-03 11:56:06 -04:00
Dynamically figure out the total size of the download based on the whether or not the client making the http request accepts gzip
This commit is contained in:
parent
e941ce0fd7
commit
fa20d7685b
2 changed files with 25 additions and 6 deletions
|
@ -229,7 +229,11 @@ class ShareMode(Mode):
|
|||
"""
|
||||
Handle REQUEST_STARTED event.
|
||||
"""
|
||||
self.downloads.add(event["data"]["id"], self.web.share_mode.download_filesize)
|
||||
if event["data"]["use_gzip"]:
|
||||
filesize = self.web.share_mode.gzip_filesize
|
||||
else:
|
||||
filesize = self.web.share_mode.download_filesize
|
||||
self.downloads.add(event["data"]["id"], filesize)
|
||||
self.downloads_in_progress += 1
|
||||
self.update_downloads_in_progress()
|
||||
|
||||
|
@ -388,6 +392,7 @@ class ZipProgressBar(QtWidgets.QProgressBar):
|
|||
|
||||
def update_processed_size(self, val):
|
||||
self._processed_size = val
|
||||
|
||||
if self.processed_size < self.total_files_size:
|
||||
self.setValue(int((self.processed_size * 100) / self.total_files_size))
|
||||
elif self.total_files_size != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue