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