Truyenhentai18: Fix search no image (#9717)

Fix search no image
This commit is contained in:
are-are-are 2025-07-20 16:56:58 +07:00 committed by Draff
parent 1f8bb317b6
commit 8bd625d00b
Signed by: Draff
GPG Key ID: E8A89F3211677653
3 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = "Truyen Hentai 18+"
extClass = ".TruyenHentai18"
extVersionCode = 5
extVersionCode = 6
isNsfw = true
}

View File

@ -25,6 +25,8 @@ class TruyenHentai18 : ParsedHttpSource() {
private val apiUrl = "https://api.th18.app"
private val cdnUrl = "https://vi-api.th18.app"
override val lang = "vi"
override val supportsLatest = true
@ -89,7 +91,7 @@ class TruyenHentai18 : ParsedHttpSource() {
}
override fun searchMangaParse(response: Response): MangasPage {
val mangas = response.parseAs<SearchDto>().data.map { it.toSManga() }
val mangas = response.parseAs<SearchDto>().data.map { it.toSManga(cdnUrl) }
return MangasPage(mangas, hasNextPage = false)
}

View File

@ -17,10 +17,12 @@ class SearchDto(
class MangaDto(
private val title: String,
private val slug: String,
private val thumbnail: String,
) {
fun toSManga() = SManga.create().apply {
fun toSManga(cdnUrl: String) = SManga.create().apply {
title = this@MangaDto.title
url = "/$slug.html"
thumbnail_url = "$cdnUrl/uploads/$thumbnail"
}
}