diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderFragment.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderFragment.java index 3477a42a1..1d8c32875 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderFragment.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderFragment.java @@ -17,6 +17,7 @@ import android.widget.TextView; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; +import java.io.File; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -145,8 +146,13 @@ public class PagerReaderFragment extends BaseFragment { if (page == null || page.getImagePath() == null) return; - imageView.setImage(ImageSource.uri(page.getImagePath())); - progressContainer.setVisibility(View.GONE); + File imagePath = new File(page.getImagePath()); + if (imagePath.exists()) { + imageView.setImage(ImageSource.uri(page.getImagePath())); + progressContainer.setVisibility(View.GONE); + } else { + page.setStatus(Page.ERROR); + } } private void showDownloading() { @@ -198,7 +204,6 @@ public class PagerReaderFragment extends BaseFragment { case Page.READY: showImage(); unsubscribeProgress(); - unsubscribeStatus(); break; case Page.ERROR: showError(); diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonHolder.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonHolder.java index 51cc39236..f0d52b496 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonHolder.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonHolder.java @@ -10,6 +10,8 @@ import android.widget.ProgressBar; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; +import java.io.File; + import butterknife.Bind; import butterknife.ButterKnife; import eu.kanade.tachiyomi.R; @@ -62,7 +64,6 @@ public class WebtoonHolder extends RecyclerView.ViewHolder { if (event.getAction() == MotionEvent.ACTION_UP) { if (page != null) adapter.retryPage(page); - return true; } return true; }); @@ -99,7 +100,14 @@ public class WebtoonHolder extends RecyclerView.ViewHolder { setErrorButtonVisible(false); setProgressVisible(false); setImageVisible(true); - imageView.setImage(ImageSource.uri(page.getImagePath())); + + File imagePath = new File(page.getImagePath()); + if (imagePath.exists()) { + imageView.setImage(ImageSource.uri(page.getImagePath())); + } else { + page.setStatus(Page.ERROR); + onError(); + } } private void onError() {