From 6eb321bb06704d2503ae0251c403fe30d9dbd7bf Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 9 Jan 2016 21:39:59 +0100 Subject: [PATCH] Don't update the chapter list if the parsed list is empty (#18) --- .../java/eu/kanade/mangafeed/data/source/base/Source.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java index 6955def23..fd669d3c0 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java @@ -84,8 +84,12 @@ public abstract class Source extends BaseSource { public Observable> pullChaptersFromNetwork(final String mangaUrl) { return networkService .getStringResponse(getBaseUrl() + mangaUrl, requestHeaders, null) - .flatMap(unparsedHtml -> - Observable.just(parseHtmlToChapters(unparsedHtml))); + .flatMap(unparsedHtml -> { + List chapters = parseHtmlToChapters(unparsedHtml); + return !chapters.isEmpty() ? + Observable.just(chapters) : + Observable.error(new Exception("No chapters found")); + }); } public Observable> getCachedPageListOrPullFromNetwork(final String chapterUrl) {