Show thumbnail uploading progress when uploading
This commit is contained in:
parent
d1e42a72a0
commit
e1b26d1ec7
1
TODO.md
1
TODO.md
|
@ -9,7 +9,6 @@
|
||||||
- nio ClientTimeout
|
- nio ClientTimeout
|
||||||
|
|
||||||
- no thumb if bigger than original
|
- no thumb if bigger than original
|
||||||
- upload delay at the end?
|
|
||||||
- Handle upload file size limit
|
- Handle upload file size limit
|
||||||
- Handle set avatar upload errors
|
- Handle set avatar upload errors
|
||||||
- Confirmation box after picking file to upload
|
- Confirmation box after picking file to upload
|
||||||
|
|
|
@ -418,9 +418,13 @@ class MatrixClient(nio.AsyncClient):
|
||||||
upload_item.total_size = len(thumb_data)
|
upload_item.total_size = len(thumb_data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# The total_size passed to the monitor only considers
|
upload_item.total_size = thumb_info.size
|
||||||
# the file itself, and not the thumbnail.
|
|
||||||
monitor.on_transferred = None
|
monitor = nio.TransferMonitor(thumb_info.size)
|
||||||
|
monitor.on_transferred = on_transferred
|
||||||
|
monitor.on_speed_changed = on_speed_changed
|
||||||
|
|
||||||
|
self.upload_monitors[item_uuid] = monitor
|
||||||
|
|
||||||
thumb_url, _, thumb_crypt_dict = await self.upload(
|
thumb_url, _, thumb_crypt_dict = await self.upload(
|
||||||
lambda *_: thumb_data,
|
lambda *_: thumb_data,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user