[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'
|
extName = 'Remanga'
|
||||||
pkgNameSuffix = 'ru.remanga'
|
pkgNameSuffix = 'ru.remanga'
|
||||||
extClass = '.Remanga'
|
extClass = '.Remanga'
|
||||||
extVersionCode = 19
|
extVersionCode = 20
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue