parent
9f9cf36a20
commit
4007461062
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Atsumaru'
|
||||
extClass = '.Atsumaru'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
||||
@ -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) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user