[RU]Remanga change/refix "single pixel" filter (#8168)

* [RU]Remanga change/refix "single pixel" filter

* move minor
This commit is contained in:
Eugene 2021-07-18 18:18:33 +05:00 committed by GitHub
parent b87a5935b8
commit 7e9ca28ae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 17 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Remanga'
pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga'
extVersionCode = 32
extVersionCode = 33
libVersion = '1.2'
}

View File

@ -6,8 +6,8 @@ import GenresDto
import LibraryDto
import MangaDetDto
import PageDto
import ChunksPageDto
import PageWrapperDto
import PaidPageDto
import SeriesWrapperDto
import UserDto
import android.annotation.SuppressLint
@ -350,11 +350,11 @@ class Remanga : ConfigurableSource, HttpSource() {
val body = response.body?.string()!!
return try {
val page = json.decodeFromString<SeriesWrapperDto<PageDto>>(body)
page.content.pages.filter { it.height > 1 }.map {
page.content.pages.filter { it.height > 10 }.map {
Page(it.page, "", it.link)
}
} catch (e: SerializationException) {
val page = json.decodeFromString<SeriesWrapperDto<PaidPageDto>>(body)
val page = json.decodeFromString<SeriesWrapperDto<ChunksPageDto>>(body)
val result = mutableListOf<Page>()
page.content.pages.forEach {
it.filter { page -> page.height > 10 }.forEach { page ->

View File

@ -101,20 +101,12 @@ data class PageDto(
val pages: List<PagesDto>
)
@Serializable
data class ChunksPageDto(
val pages: List<List<PagesDto>>
)
@Serializable
data class UserDto(
val access_token: String
)
@Serializable
data class PaidPagesDto(
val id: Long,
val link: String,
val height: Int,
val page: Int
)
@Serializable
data class PaidPageDto(
val pages: List<List<PaidPagesDto>>
)