Ver código fonte

Fix incomplete downloads. Closes #264

len 9 anos atrás
pai
commit
877032a757

+ 6 - 0
app/src/main/java/eu/kanade/tachiyomi/data/source/base/Source.kt

@@ -188,6 +188,12 @@ abstract class Source(context: Context) : BaseSource() {
 
     open fun getImageProgressResponse(page: Page): Observable<Response> {
         return networkService.requestBodyProgress(imageRequest(page), page)
+                .doOnNext {
+                    if (!it.isSuccessful) {
+                        it.body().close()
+                        throw RuntimeException("Not a valid response")
+                    }
+                }
     }
 
     fun savePageList(chapterUrl: String, pages: List<Page>?) {