[Ru]Remanga. Fix single pixel pages (#6602)

Co-authored-by: pavkazzz <me@pavkazzz.ru>
This commit is contained in:
Pavka 2021-04-18 21:30:38 +03:00 committed by GitHub
parent 9ac5f26fc7
commit 8da7c936d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Remanga' extName = 'Remanga'
pkgNameSuffix = 'ru.remanga' pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga' extClass = '.Remanga'
extVersionCode = 19 extVersionCode = 20
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -320,16 +320,15 @@ class Remanga : ConfigurableSource, HttpSource() {
val body = response.body()?.string()!! val body = response.body()?.string()!!
return try { return try {
val page = gson.fromJson<SeriesWrapperDto<PageDto>>(body) val page = gson.fromJson<SeriesWrapperDto<PageDto>>(body)
page.content.pages.filter { it.height > 1 }.map {
page.content.pages.map {
Page(it.page, "", it.link) Page(it.page, "", it.link)
} }
} catch (e: JsonSyntaxException) { } catch (e: JsonSyntaxException) {
val page = gson.fromJson<SeriesWrapperDto<PaidPageDto>>(body) val page = gson.fromJson<SeriesWrapperDto<PaidPageDto>>(body)
val result = mutableListOf<Page>() val result = mutableListOf<Page>()
page.content.pages.forEach { page.content.pages.forEach {
it.forEach { it.filter { page -> page.height > 1 }.forEach { page ->
result.add(Page(result.size, "", it.link)) result.add(Page(result.size, "", page.link))
} }
} }
return result return result

View File

@ -80,6 +80,7 @@ data class BookDto(
data class PagesDto( data class PagesDto(
val id: Int, val id: Int,
val height: Int,
val link: String, val link: String,
val page: Int, val page: Int,
val count_comments: Int val count_comments: Int
@ -96,6 +97,7 @@ data class UserDto(
data class PaidPagesDto( data class PaidPagesDto(
val id: Long, val id: Long,
val link: String, val link: String,
val height: Int,
val page: Int val page: Int
) )