mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 12:47:26 +01:00
Don't update the chapter list if the parsed list is empty (#18)
This commit is contained in:
parent
201650ced7
commit
6eb321bb06
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user