Only add the download_filename to cleanup_filenames (which get deleted) if the file is zipped up. Otherwise, OnionShare deletes the original file

This commit is contained in:
Micah Lee 2018-09-20 23:18:17 -07:00
parent ea938e2439
commit 81fa5e052c
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 4 additions and 2 deletions

View File

@ -120,7 +120,8 @@ def main(cwd=None):
print(strings._("preparing_files")) print(strings._("preparing_files"))
try: try:
web.set_file_info(filenames) web.set_file_info(filenames)
app.cleanup_filenames.append(web.download_filename) if web.is_zipped:
app.cleanup_filenames.append(web.download_filename)
except OSError as e: except OSError as e:
print(e.strerror) print(e.strerror)
sys.exit(1) sys.exit(1)

View File

@ -47,7 +47,8 @@ class CompressThread(QtCore.QThread):
# Cancelled # Cancelled
pass pass
self.mode.app.cleanup_filenames.append(self.mode.web.download_filename) if self.mode.web.is_zipped:
self.mode.app.cleanup_filenames.append(self.mode.web.download_filename)
except OSError as e: except OSError as e:
self.error.emit(e.strerror) self.error.emit(e.strerror)