zaimanhua: fix search and detail (#8323)
This commit is contained in:
parent
86369167da
commit
303b789fff
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Zaimanhua'
|
||||
extClass = '.Zaimanhua'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ class Zaimanhua : HttpSource(), ConfigurableSource {
|
||||
"$accountApiUrl/userInfo/get",
|
||||
headersBuilder().setToken(token).build(),
|
||||
),
|
||||
).execute().parseAs<ResponseDto<UserDto>>()
|
||||
).execute().parseAs<SimpleResponseDto>()
|
||||
return response.errno == 0
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ class Zaimanhua : HttpSource(), ConfigurableSource {
|
||||
// Detail
|
||||
// path: "/comic/detail/mangaId"
|
||||
override fun mangaDetailsRequest(manga: SManga): Request =
|
||||
GET("$apiUrl/comic/detail/${manga.url}", apiHeaders)
|
||||
GET("$apiUrl/comic/detail/${manga.url}?channel=android", apiHeaders)
|
||||
|
||||
override fun mangaDetailsParse(response: Response): SManga {
|
||||
val result = response.parseAs<ResponseDto<DataWrapperDto<MangaDto>>>()
|
||||
|
@ -112,8 +112,9 @@ class PageDto(
|
||||
|
||||
@Serializable
|
||||
class PageItemDto(
|
||||
@JsonNames("comic_id")
|
||||
private val id: Int,
|
||||
private val id: Int = 0,
|
||||
@SerialName("comic_id")
|
||||
private val comicId: Int = 0,
|
||||
private val title: String,
|
||||
private val authors: String = "",
|
||||
private val status: String,
|
||||
@ -121,7 +122,11 @@ class PageItemDto(
|
||||
private val types: String,
|
||||
) {
|
||||
fun toSManga() = SManga.create().apply {
|
||||
url = this@PageItemDto.id.toString()
|
||||
url = if (this@PageItemDto.id != 0) {
|
||||
this@PageItemDto.id.toString()
|
||||
} else {
|
||||
this@PageItemDto.comicId.toString()
|
||||
}
|
||||
title = this@PageItemDto.title
|
||||
author = authors.formatList()
|
||||
genre = types.formatList()
|
||||
|
Loading…
x
Reference in New Issue
Block a user