Fix: page ordering & broken chapter loading (#16959)

* fix: Chapter preview broke loading of all other chapters

* fix: Page ordering

* updated version

* applied PR suggestions
This commit is contained in:
THE_ORONCO 2023-07-02 22:38:30 +02:00 committed by GitHub
parent dbb4f6a0e0
commit c4b08d04e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'aurora' extName = 'aurora'
pkgNameSuffix = 'en.aurora' pkgNameSuffix = 'en.aurora'
extClass = '.Aurora' extClass = '.Aurora'
extVersionCode = 3 extVersionCode = 4
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -30,7 +30,7 @@ class Aurora : HttpSource() {
override fun chapterListParse(response: Response): List<SChapter> = throw Exception("Not used") override fun chapterListParse(response: Response): List<SChapter> = throw Exception("Not used")
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> { override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
return Observable.just(fetchChapterListTR(baseUrl + manga.url, mutableListOf())) return Observable.just(fetchChapterListTR(baseUrl + manga.url, mutableListOf()).reversed())
} }
private tailrec fun fetchChapterListTR( private tailrec fun fetchChapterListTR(
@ -144,8 +144,8 @@ class Aurora : HttpSource() {
val chapterArchiveUrl = "$baseUrl/archive/" val chapterArchiveUrl = "$baseUrl/archive/"
val chapterOverviewDoc = client.newCall(GET(chapterArchiveUrl, headers)).execute().asJsoup() val chapterOverviewDoc = client.newCall(GET(chapterArchiveUrl, headers)).execute().asJsoup()
val chapterBlockElements = chapterOverviewDoc.select(".wp-block-image") val chapterBlockElements = chapterOverviewDoc.select(".wp-block-image:has(a)")
val mangasFromChapters = chapterBlockElements val mangasFromChapters: List<SManga> = chapterBlockElements
.mapIndexed { chapterIndex, chapter -> .mapIndexed { chapterIndex, chapter ->
val chapterOverviewLink = chapter.selectFirst("a")!! val chapterOverviewLink = chapter.selectFirst("a")!!
val chapterOverviewUrl = chapterOverviewLink.attr("href") val chapterOverviewUrl = chapterOverviewLink.attr("href")