[RU]Remanga fix lastEx (why deploy the find in the past commit) (#16298)

This commit is contained in:
Eshlender 2023-05-06 19:17:05 +05:00 committed by GitHub
parent 1d5418f3b9
commit 4f32f6e8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Remanga' extName = 'Remanga'
pkgNameSuffix = 'ru.remanga' pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga' extClass = '.Remanga'
extVersionCode = 74 extVersionCode = 75
} }
dependencies { dependencies {

View File

@ -422,7 +422,7 @@ class Remanga : ConfigurableSource, HttpSource() {
} }
private fun filterPaid(tempChaptersList: MutableList<SChapter>): MutableList<SChapter> { private fun filterPaid(tempChaptersList: MutableList<SChapter>): MutableList<SChapter> {
val lastEx = tempChaptersList.findLast { it.scanlator.equals("exmanga") } val lastEx = tempChaptersList.find { it.scanlator.equals("exmanga") }
return if (!preferences.getBoolean(PAID_PREF, false)) { return if (!preferences.getBoolean(PAID_PREF, false)) {
tempChaptersList.filter { tempChaptersList.filter {
!it.name.contains("\uD83D\uDCB2") || if (lastEx != null) { !it.name.contains("\uD83D\uDCB2") || if (lastEx != null) {
@ -485,7 +485,7 @@ class Remanga : ConfigurableSource, HttpSource() {
val response = chapterListRequest(selectedBranch2.id, it) val response = chapterListRequest(selectedBranch2.id, it)
chapterListParse(response, manga, exChapters) chapterListParse(response, manga, exChapters)
}.let { tempChaptersList.addAll(0, it.flatten()) } }.let { tempChaptersList.addAll(0, it.flatten()) }
return filterPaid(tempChaptersList).distinctBy { it.name.substringBefore(". Глава") + "--" + it.chapter_number }.sortedWith(compareBy({ it.name.substringBefore(". Глава").toFloat() }, { it.chapter_number })).reversed().let { Observable.just(it) } return filterPaid(tempChaptersList).distinctBy { it.name.substringBefore(". Глава") + "--" + it.chapter_number }.sortedWith(compareBy({ it.name.substringBefore(". Глава").toIntOrNull()!! }, { it.chapter_number })).reversed().let { Observable.just(it) }
} }
} }
} }