Fix download progress indicator (#8188)
(cherry picked from commit b1e104319f90678bc7ed501797d9d7d5b98902b5)
This commit is contained in:
parent
46b268491a
commit
1b6c970cc2
@ -322,13 +322,14 @@ class Downloader(
|
|||||||
val pageListObservable = if (download.pages == null) {
|
val pageListObservable = if (download.pages == null) {
|
||||||
// Pull page list from network and add them to download object
|
// Pull page list from network and add them to download object
|
||||||
download.source.fetchPageList(download.chapter)
|
download.source.fetchPageList(download.chapter)
|
||||||
.doOnNext { pages ->
|
.map { pages ->
|
||||||
if (pages.isEmpty()) {
|
if (pages.isEmpty()) {
|
||||||
throw Exception(context.getString(R.string.page_list_empty_error))
|
throw Exception(context.getString(R.string.page_list_empty_error))
|
||||||
}
|
}
|
||||||
// Don't trust index from source
|
// Don't trust index from source
|
||||||
val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) }
|
val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) }
|
||||||
download.pages = reIndexedPages
|
download.pages = reIndexedPages
|
||||||
|
reIndexedPages
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Or if the page list already exists, start from the file
|
// Or if the page list already exists, start from the file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user