mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-14 05:31:25 -05:00
Don't consider individual downloads in the in_progress counter
This commit is contained in:
parent
79f563e443
commit
bd3a7fe1f7
@ -177,7 +177,8 @@ class SendBaseModeWeb:
|
|||||||
|
|
||||||
self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_PROGRESS, path, {
|
self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_PROGRESS, path, {
|
||||||
'id': history_id,
|
'id': history_id,
|
||||||
'bytes': downloaded_bytes
|
'bytes': downloaded_bytes,
|
||||||
|
'filesize': filesize
|
||||||
})
|
})
|
||||||
done = False
|
done = False
|
||||||
except:
|
except:
|
||||||
|
@ -427,9 +427,6 @@ class Mode(QtWidgets.QWidget):
|
|||||||
"""
|
"""
|
||||||
item = IndividualFileHistoryItem(self.common, event["data"], event["path"])
|
item = IndividualFileHistoryItem(self.common, event["data"], event["path"])
|
||||||
self.history.add(event["data"]["id"], item)
|
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):
|
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"])
|
self.history.update(event["data"]["id"], event["data"]["bytes"])
|
||||||
|
|
||||||
# Is the download complete?
|
if self.server_status.status == self.server_status.STATUS_STOPPED:
|
||||||
if event["data"]["bytes"] == self.web.share_mode.filesize:
|
self.history.cancel(event["data"]["id"])
|
||||||
# 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()
|
|
||||||
|
|
||||||
def handle_request_individual_file_canceled(self, event):
|
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.
|
Used in both Share and Website modes, so implemented here.
|
||||||
"""
|
"""
|
||||||
self.history.cancel(event["data"]["id"])
|
self.history.cancel(event["data"]["id"])
|
||||||
|
|
||||||
# Update in progress count
|
|
||||||
self.history.in_progress_count -= 1
|
|
||||||
self.history.update_in_progress()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user