parent
9f9cf36a20
commit
4007461062
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Atsumaru'
|
extName = 'Atsumaru'
|
||||||
extClass = '.Atsumaru'
|
extClass = '.Atsumaru'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,16 +63,19 @@ class MangaDto(
|
|||||||
// Chapters
|
// Chapters
|
||||||
val chapters: List<ChapterDto>? = null,
|
val chapters: List<ChapterDto>? = null,
|
||||||
) {
|
) {
|
||||||
private fun getImagePath(): String? = when (imagePath) {
|
private fun getImagePath(): String? {
|
||||||
is JsonPrimitive -> imagePath.content
|
val url = when (imagePath) {
|
||||||
is JsonObject -> imagePath["image"]?.jsonPrimitive?.content
|
is JsonPrimitive -> imagePath.content
|
||||||
else -> null
|
is JsonObject -> imagePath["image"]?.jsonPrimitive?.content
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
return url?.removePrefix("/")?.removePrefix("static/")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toSManga(baseUrl: String): SManga = SManga.create().apply {
|
fun toSManga(baseUrl: String): SManga = SManga.create().apply {
|
||||||
url = id
|
url = id
|
||||||
title = this@MangaDto.title
|
title = this@MangaDto.title
|
||||||
thumbnail_url = getImagePath().let { it -> baseUrl + it }
|
thumbnail_url = getImagePath().let { it -> "$baseUrl/static/$it" }
|
||||||
description = synopsis
|
description = synopsis
|
||||||
genre = buildList {
|
genre = buildList {
|
||||||
type?.let { add(it) }
|
type?.let { add(it) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user