Atsumaru: Fix covers (#11046)

fix covers
This commit is contained in:
bapeey 2025-10-13 08:06:37 -05:00 committed by Draff
parent 9f9cf36a20
commit 4007461062
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 9 additions and 6 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Atsumaru'
extClass = '.Atsumaru'
extVersionCode = 4
extVersionCode = 5
isNsfw = true
}

View File

@ -63,16 +63,19 @@ class MangaDto(
// Chapters
val chapters: List<ChapterDto>? = null,
) {
private fun getImagePath(): String? = when (imagePath) {
is JsonPrimitive -> imagePath.content
is JsonObject -> imagePath["image"]?.jsonPrimitive?.content
else -> null
private fun getImagePath(): String? {
val url = when (imagePath) {
is JsonPrimitive -> imagePath.content
is JsonObject -> imagePath["image"]?.jsonPrimitive?.content
else -> null
}
return url?.removePrefix("/")?.removePrefix("static/")
}
fun toSManga(baseUrl: String): SManga = SManga.create().apply {
url = id
title = this@MangaDto.title
thumbnail_url = getImagePath().let { it -> baseUrl + it }
thumbnail_url = getImagePath().let { it -> "$baseUrl/static/$it" }
description = synopsis
genre = buildList {
type?.let { add(it) }