From a66beaf8d3eebd157423cecc0f7ac025e50ea6b6 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Thu, 10 Aug 2023 03:43:42 +0800 Subject: [PATCH] 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> --- src/zh/yidan/build.gradle | 2 +- .../yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Dto.kt | 4 ++-- .../src/eu/kanade/tachiyomi/extension/zh/yidan/Yidan.kt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/zh/yidan/build.gradle b/src/zh/yidan/build.gradle index f4b77e699..34440c22d 100644 --- a/src/zh/yidan/build.gradle +++ b/src/zh/yidan/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Yidan Girl' pkgNameSuffix = 'zh.yidan' extClass = '.Yidan' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Dto.kt b/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Dto.kt index 73c90434e..ad7a94464 100644 --- a/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Dto.kt +++ b/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Dto.kt @@ -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 } } diff --git a/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Yidan.kt b/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Yidan.kt index 085fdb789..65b3e5c73 100644 --- a/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Yidan.kt +++ b/src/zh/yidan/src/eu/kanade/tachiyomi/extension/zh/yidan/Yidan.kt @@ -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().toSManga() + response.parseAs().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") } }