MangaLib: Fixed sorting by translator (#7062)

This commit is contained in:
Blue cat 2021-05-17 20:52:29 +03:00 committed by GitHub
parent 640b5f035d
commit c06c47caac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga'
extVersionCode = 46
extVersionCode = 47
libVersion = '1.2'
}

View File

@ -230,7 +230,7 @@ class LibManga : ConfigurableSource, HttpSource() {
for (currentBranch in branches.withIndex()) {
val teamId = branches[currentBranch.index]["id"].int
chapters = chaptersList
?.filter { it["branch_id"].int == teamId && it["status"].nullInt != 2 }
?.filter { it["branch_id"].nullInt == teamId && it["status"].nullInt != 2 }
?.map { chapterFromElement(it, sortingList, slug, teamId, branches) }
chapters?.let { tempChaptersList.addAll(it) }
}
@ -241,14 +241,14 @@ class LibManga : ConfigurableSource, HttpSource() {
for (currentBranch in branches.withIndex()) {
val teamId = branches[currentBranch.index]["id"].int
val chapterSize = chaptersList
?.filter { it["branch_id"].int == teamId }!!.size
?.filter { it["branch_id"].nullInt == teamId }!!.size
sizesChaptersLists.add(chapterSize)
}
val max = sizesChaptersLists.indexOfFirst { it == sizesChaptersLists.maxOrNull() ?: 0 }
val teamId = branches[max]["id"].int
chapters = chaptersList
?.filter { it["branch_id"].int == teamId && it["status"].nullInt != 2 }
?.filter { it["branch_id"].nullInt == teamId && it["status"].nullInt != 2 }
?.map { chapterFromElement(it, sortingList, slug, teamId, branches) }
}
"ms_active" -> {
@ -258,7 +258,7 @@ class LibManga : ConfigurableSource, HttpSource() {
if (teams[currentTeam.index]["is_active"].int == 1) {
val teamId = branches[currentBranch.index]["id"].int
chapters = chaptersList
?.filter { it["branch_id"].int == teamId && it["status"].nullInt != 2 }
?.filter { it["branch_id"].nullInt == teamId && it["status"].nullInt != 2 }
?.map { chapterFromElement(it, sortingList, slug, teamId, branches) }
break
}