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