From 877032a7575167ca6ea65ad95c465a0a4e860b24 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 20 Apr 2016 17:10:10 +0200 Subject: [PATCH] Fix incomplete downloads. Closes #264 --- .../java/eu/kanade/tachiyomi/data/source/base/Source.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/base/Source.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/base/Source.kt index 50775c99d..488d5c079 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/base/Source.kt +++ b/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 { 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?) {