mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix wrong downloaded percentage when server doesn't send content length. Fixes #1019
This commit is contained in:
		@@ -130,7 +130,11 @@ class PageView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
 | 
			
		||||
                .onBackpressureLatest()
 | 
			
		||||
                .observeOn(AndroidSchedulers.mainThread())
 | 
			
		||||
                .subscribe { progress ->
 | 
			
		||||
                    progress_text.text = context.getString(R.string.download_progress, progress)
 | 
			
		||||
                    progress_text.text = if (progress > 0) {
 | 
			
		||||
                        context.getString(R.string.download_progress, progress)
 | 
			
		||||
                    } else {
 | 
			
		||||
                        context.getString(R.string.downloading)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -150,7 +150,11 @@ class WebtoonHolder(private val view: View, private val adapter: WebtoonAdapter)
 | 
			
		||||
                .onBackpressureLatest()
 | 
			
		||||
                .observeOn(AndroidSchedulers.mainThread())
 | 
			
		||||
                .subscribe { progress ->
 | 
			
		||||
                    view.progress_text.text = view.context.getString(R.string.download_progress, progress)
 | 
			
		||||
                    view.progress_text.text = if (progress > 0) {
 | 
			
		||||
                        view.context.getString(R.string.download_progress, progress)
 | 
			
		||||
                    } else {
 | 
			
		||||
                        view.context.getString(R.string.downloading)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
        addSubscription(progressSubscription)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user