[RU]Remanga merge branches (#16160)

* [RU]Remanga merge branches

* extVersionCode
This commit is contained in:
Eshlender 2023-04-25 22:19:36 +05:00 committed by GitHub
parent 61d34b9ff8
commit df48c23378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

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

View File

@ -439,10 +439,25 @@ class Remanga : ConfigurableSource, HttpSource() {
emptyList()
}
val selectedBranch = branch.maxByOrNull { selector(it) }!!
return (1..(selectedBranch.count_chapters / 100 + 1)).map {
val tempChaptersList = mutableListOf<SChapter>()
if (branch.size > 1) {
val selectedBranch2 =
branch.filter { it.id != selectedBranch.id }.maxByOrNull { selector(it) }!!
if (selectedBranch.count_chapters < json.decodeFromString<SeriesWrapperDto<List<BookDto>>>(
chapterListRequest(selectedBranch2.id, 1).body.string(),
).content.firstOrNull()?.chapter?.toFloatOrNull()!!
) {
(1..(selectedBranch2.count_chapters / 100 + 1)).map {
val response = chapterListRequest(selectedBranch2.id, it)
chapterListParse(response, manga, exChapters)
}.let { tempChaptersList.addAll(it.flatten()) }
}
}
(1..(selectedBranch.count_chapters / 100 + 1)).map {
val response = chapterListRequest(selectedBranch.id, it)
chapterListParse(response, manga, exChapters)
}.let { Observable.just(it.flatten()) }
}.let { tempChaptersList.addAll(it.flatten()) }
return tempChaptersList.distinctBy { it.name.substringBefore(". Глава") + "--" + it.chapter_number }.sortedWith(compareBy({ -it.chapter_number }, { it.name.substringBefore(". Глава") })).let { Observable.just(it) }
}
}
}