summaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-09-03 21:59:49 -0700
committerMicah Lee <micah@micahflee.com>2019-09-03 21:59:49 -0700
commit655bb5bad1ccadd3aaa0f4bd20119de350429be5 (patch)
tree5352c32a1651897ee236606c5567bc94df93369c /onionshare
parent644b47082a716de9a7e2311b9f3c2a75c4d96fbe (diff)
downloadonionshare-655bb5bad1ccadd3aaa0f4bd20119de350429be5.tar.gz
onionshare-655bb5bad1ccadd3aaa0f4bd20119de350429be5.zip
Show IndividualFileHistoryItem widgets for directory listings
Diffstat (limited to 'onionshare')
-rw-r--r--onionshare/web/send_base_mode.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/onionshare/web/send_base_mode.py b/onionshare/web/send_base_mode.py
index 402bc32f..eb6525d1 100644
--- a/onionshare/web/send_base_mode.py
+++ b/onionshare/web/send_base_mode.py
@@ -79,6 +79,15 @@ class SendBaseModeWeb:
self.set_file_info_custom(filenames, processed_size_callback)
def directory_listing(self, filenames, path='', filesystem_path=None):
+ # Tell the GUI about the directory listing
+ download_id = self.download_count
+ self.download_count += 1
+ self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_STARTED, '/{}'.format(path), {
+ 'id': download_id,
+ 'method': request.method,
+ 'directory_listing': True
+ })
+
# If filesystem_path is None, this is the root directory listing
files, dirs = self.build_directory_listing(filenames, filesystem_path)
r = self.directory_listing_template(path, files, dirs)
@@ -132,13 +141,11 @@ class SendBaseModeWeb:
file_to_download = filesystem_path
filesize = os.path.getsize(filesystem_path)
- # Each download has a unique id
- download_id = self.download_count
- self.download_count += 1
-
path = request.path
# Tell GUI the individual file started
+ download_id = self.download_count
+ self.download_count += 1
self.web.add_request(self.web.REQUEST_INDIVIDUAL_FILE_STARTED, path, {
'id': download_id,
'filesize': filesize,