[Ru]Remanga. Fix single pixel pages (#6602)
Co-authored-by: pavkazzz <me@pavkazzz.ru>
This commit is contained in:
parent
9ac5f26fc7
commit
8da7c936d8
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Remanga'
|
||||
pkgNameSuffix = 'ru.remanga'
|
||||
extClass = '.Remanga'
|
||||
extVersionCode = 19
|
||||
extVersionCode = 20
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -320,16 +320,15 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||
val body = response.body()?.string()!!
|
||||
return try {
|
||||
val page = gson.fromJson<SeriesWrapperDto<PageDto>>(body)
|
||||
|
||||
page.content.pages.map {
|
||||
page.content.pages.filter { it.height > 1 }.map {
|
||||
Page(it.page, "", it.link)
|
||||
}
|
||||
} catch (e: JsonSyntaxException) {
|
||||
val page = gson.fromJson<SeriesWrapperDto<PaidPageDto>>(body)
|
||||
val result = mutableListOf<Page>()
|
||||
page.content.pages.forEach {
|
||||
it.forEach {
|
||||
result.add(Page(result.size, "", it.link))
|
||||
it.filter { page -> page.height > 1 }.forEach { page ->
|
||||
result.add(Page(result.size, "", page.link))
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
|
|
@ -80,6 +80,7 @@ data class BookDto(
|
|||
|
||||
data class PagesDto(
|
||||
val id: Int,
|
||||
val height: Int,
|
||||
val link: String,
|
||||
val page: Int,
|
||||
val count_comments: Int
|
||||
|
@ -96,6 +97,7 @@ data class UserDto(
|
|||
data class PaidPagesDto(
|
||||
val id: Long,
|
||||
val link: String,
|
||||
val height: Int,
|
||||
val page: Int
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue