Yidan Girl: fix thumbnail (#17427)
* Yidan Girl: fix thumbnail * Yidan Girl: remove dead domains Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com> --------- Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
This commit is contained in:
parent
e2c5be2b47
commit
a66beaf8d3
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'Yidan Girl'
|
||||
pkgNameSuffix = 'zh.yidan'
|
||||
extClass = '.Yidan'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class MangaDto(
|
|||
private val coverPic: String?,
|
||||
private val id: Int,
|
||||
) {
|
||||
fun toSManga() = SManga.create().apply {
|
||||
fun toSManga(baseUrl: String) = SManga.create().apply {
|
||||
url = id.toString()
|
||||
title = this@MangaDto.title
|
||||
author = this@MangaDto.author
|
||||
|
@ -29,7 +29,7 @@ class MangaDto(
|
|||
"5" in mhcate.split(",") -> SManga.COMPLETED
|
||||
else -> SManga.ONGOING
|
||||
}
|
||||
thumbnail_url = coverPic
|
||||
thumbnail_url = if (coverPic?.startsWith("http") == true) coverPic else baseUrl + coverPic
|
||||
initialized = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class Yidan : HttpSource(), ConfigurableSource {
|
|||
|
||||
override fun popularMangaParse(response: Response): MangasPage {
|
||||
val listing: ListingDto = response.parseAs()
|
||||
val mangas = listing.list.map { it.toSManga() }
|
||||
val mangas = listing.list.map { it.toSManga(baseUrl) }
|
||||
val hasNextPage = run {
|
||||
val url = response.request.url
|
||||
val pageSize = url.queryParameter("pageSize")!!.toInt()
|
||||
|
@ -84,7 +84,7 @@ class Yidan : HttpSource(), ConfigurableSource {
|
|||
}
|
||||
|
||||
override fun mangaDetailsParse(response: Response) =
|
||||
response.parseAs<MangaDto>().toSManga()
|
||||
response.parseAs<MangaDto>().toSManga(baseUrl)
|
||||
|
||||
override fun chapterListRequest(manga: SManga) =
|
||||
GET("$baseUrl/prod-api/app-api/vv/mh-episodes/list?mhid=${manga.url}", headers)
|
||||
|
@ -132,6 +132,6 @@ class Yidan : HttpSource(), ConfigurableSource {
|
|||
|
||||
companion object {
|
||||
private const val MIRROR_PREF = "MIRROR"
|
||||
private val MIRRORS get() = arrayOf("ydan.cc", "ydan.vip", "dans.cc")
|
||||
private val MIRRORS get() = arrayOf("ydan.cc", "yidan.one", "yidan.in", "yidan.info")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue