[RU]Remanga latestUpdates quality covers & status 1.3 (#12157)

This commit is contained in:
Ejan 2022-06-11 20:37:58 +05:00 committed by GitHub
parent cbded92086
commit a561eaa219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 20 deletions

View File

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

View File

@ -8,7 +8,6 @@ import MangaDetDto
import MyLibraryDto
import PageDto
import PageWrapperDto
import PageWrapperDtoNoLimit
import SeriesWrapperDto
import TagsDto
import UserDto
@ -122,15 +121,9 @@ class Remanga : ConfigurableSource, HttpSource() {
override fun popularMangaParse(response: Response): MangasPage = searchMangaParse(response)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/api/titles/last-chapters/?page=$page&count=$count", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/api/search/catalog/?ordering=-chapter_date&count=$count&page=$page", headers)
override fun latestUpdatesParse(response: Response): MangasPage {
val page = json.decodeFromString<PageWrapperDtoNoLimit<LibraryDto>>(response.body!!.string())
val mangas = page.content.map {
it.toSManga()
}
return MangasPage(mangas, mangas.isNotEmpty())
}
override fun latestUpdatesParse(response: Response): MangasPage = searchMangaParse(response)
override fun searchMangaParse(response: Response): MangasPage {
if (response.request.url.toString().contains("/bookmarks/")) {
@ -233,11 +226,12 @@ class Remanga : ConfigurableSource, HttpSource() {
private fun parseStatus(status: Int): Int {
return when (status) {
0 -> SManga.COMPLETED
1 -> SManga.ONGOING
2 -> SManga.ONGOING
3 -> SManga.ONGOING
5 -> SManga.LICENSED
0 -> SManga.COMPLETED // Закончен
1 -> SManga.ONGOING // Продолжается
2 -> SManga.ON_HIATUS // Заморожен
3 -> SManga.ON_HIATUS // Нет переводчика
4 -> SManga.ONGOING // Анонс
5 -> SManga.LICENSED // Лицензировано
else -> SManga.UNKNOWN
}
}

View File

@ -71,11 +71,6 @@ data class PageWrapperDto<T>(
val props: PropsDto
)
@Serializable
data class PageWrapperDtoNoLimit<T>(
val content: List<T>
)
@Serializable
data class SeriesWrapperDto<T>(
val content: T