Don't update the chapter list if the parsed list is empty (#18)
This commit is contained in:
parent
201650ced7
commit
6eb321bb06
1 changed files with 6 additions and 2 deletions
|
@ -84,8 +84,12 @@ public abstract class Source extends BaseSource {
|
||||||
public Observable<List<Chapter>> pullChaptersFromNetwork(final String mangaUrl) {
|
public Observable<List<Chapter>> pullChaptersFromNetwork(final String mangaUrl) {
|
||||||
return networkService
|
return networkService
|
||||||
.getStringResponse(getBaseUrl() + mangaUrl, requestHeaders, null)
|
.getStringResponse(getBaseUrl() + mangaUrl, requestHeaders, null)
|
||||||
.flatMap(unparsedHtml ->
|
.flatMap(unparsedHtml -> {
|
||||||
Observable.just(parseHtmlToChapters(unparsedHtml)));
|
List<Chapter> chapters = parseHtmlToChapters(unparsedHtml);
|
||||||
|
return !chapters.isEmpty() ?
|
||||||
|
Observable.just(chapters) :
|
||||||
|
Observable.error(new Exception("No chapters found"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<List<Page>> getCachedPageListOrPullFromNetwork(final String chapterUrl) {
|
public Observable<List<Page>> getCachedPageListOrPullFromNetwork(final String chapterUrl) {
|
||||||
|
|
Reference in a new issue