summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-09-08 11:58:44 -0700
committerMicah Lee <micah@micahflee.com>2019-09-08 11:58:44 -0700
commitde67484f09058af70e443e0bc1ebc1c8af2a8ab2 (patch)
treef663779e52a7906000b0b35bb91c6fd2f35f44ba
parentf089ae5847164382a814623196b72638253715ac (diff)
downloadonionshare-de67484f09058af70e443e0bc1ebc1c8af2a8ab2.tar.gz
onionshare-de67484f09058af70e443e0bc1ebc1c8af2a8ab2.zip
Don't consider individual downloads in the in_progress counter
-rw-r--r--onionshare/web/send_base_mode.py3
-rw-r--r--onionshare_gui/mode/__init__.py22
2 files changed, 4 insertions, 21 deletions
diff --git a/onionshare/web/send_base_mode.py b/onionshare/web/send_base_mode.py
index 6a0390ab..a6ad2307 100644
--- a/onionshare/web/send_base_mode.py
+++ b/onionshare/web/send_base_mode.py
@@ -177,7 +177,8 @@ class SendBaseModeWeb:
self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_PROGRESS, path, {
'id': history_id,
- 'bytes': downloaded_bytes
+ 'bytes': downloaded_bytes,
+ 'filesize': filesize
})
done = False
except:
diff --git a/onionshare_gui/mode/__init__.py b/onionshare_gui/mode/__init__.py
index b5a95f41..69ad00e6 100644
--- a/onionshare_gui/mode/__init__.py
+++ b/onionshare_gui/mode/__init__.py
@@ -427,9 +427,6 @@ class Mode(QtWidgets.QWidget):
"""
item = IndividualFileHistoryItem(self.common, event["data"], event["path"])
self.history.add(event["data"]["id"], item)
- self.toggle_history.update_indicator(True)
- self.history.in_progress_count += 1
- self.history.update_in_progress()
def handle_request_individual_file_progress(self, event):
"""
@@ -438,19 +435,8 @@ class Mode(QtWidgets.QWidget):
"""
self.history.update(event["data"]["id"], event["data"]["bytes"])
- # Is the download complete?
- if event["data"]["bytes"] == self.web.share_mode.filesize:
- # Update completed and in progress labels
- self.history.completed_count += 1
- self.history.in_progress_count -= 1
- self.history.update_completed()
- self.history.update_in_progress()
-
- else:
- if self.server_status.status == self.server_status.STATUS_STOPPED:
- self.history.cancel(event["data"]["id"])
- self.history.in_progress_count = 0
- self.history.update_in_progress()
+ if self.server_status.status == self.server_status.STATUS_STOPPED:
+ self.history.cancel(event["data"]["id"])
def handle_request_individual_file_canceled(self, event):
"""
@@ -458,7 +444,3 @@ class Mode(QtWidgets.QWidget):
Used in both Share and Website modes, so implemented here.
"""
self.history.cancel(event["data"]["id"])
-
- # Update in progress count
- self.history.in_progress_count -= 1
- self.history.update_in_progress()