[RU]Remanga notEmpty filtered page for load next page (#12227)

* [RU]Remanga notEmpty filtered page for load next page

* -0+
This commit is contained in:
Ejan 2022-06-18 07:36:59 +05:00 committed by GitHub
parent 063a884254
commit e8a6799890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

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

View File

@ -139,9 +139,21 @@ class Remanga : ConfigurableSource, HttpSource() {
if (preferences.getBoolean(isLib_PREF, false)) {
content = content.filter { it.bookmark_type.isNullOrEmpty() }
}
val mangas = content.map {
var mangas = content.map {
it.toSManga()
}
if (mangas.isEmpty() && page.props.page < page.props.total_pages && preferences.getBoolean(isLib_PREF, false))
mangas = listOf(
SManga.create().apply {
val nextPage = "Пустая страница. Всё в «Закладках»"
title = nextPage
url = nextPage
thumbnail_url = "$baseUrl/icon.png"
}
)
return MangasPage(mangas, page.props.page < page.props.total_pages)
}
}
@ -246,7 +258,7 @@ class Remanga : ConfigurableSource, HttpSource() {
return when (age_limit) {
2 -> "18+"
1 -> "16+"
else -> "0+"
else -> ""
}
}