mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	Fix wrong downloaded percentage when server doesn't send content length. Fixes #1019
This commit is contained in:
		| @@ -28,7 +28,11 @@ class Page( | ||||
|     @Transient private var statusSubject: Subject<Int, Int>? = null | ||||
|  | ||||
|     override fun update(bytesRead: Long, contentLength: Long, done: Boolean) { | ||||
|         progress = (100 * bytesRead / contentLength).toInt() | ||||
|         progress = if (contentLength > 0) { | ||||
|             (100 * bytesRead / contentLength).toInt() | ||||
|         } else { | ||||
|             -1 | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     fun setStatusSubject(subject: Subject<Int, Int>?) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user