Kemono: fix search (#13522)

This commit is contained in:
stevenyomi 2022-09-21 03:44:25 +08:00 committed by GitHub
parent ad7c766be2
commit 96cfadbf46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,8 @@ package eu.kanade.tachiyomi.multisrc.kemono
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.double
import java.text.SimpleDateFormat
import java.util.Locale
@ -11,9 +13,12 @@ class KemonoCreatorDto(
private val id: String,
val name: String,
private val service: String,
private val updated: String,
private val updated: JsonPrimitive,
) {
val updatedDate get() = dateFormat.parse(updated)?.time ?: 0
val updatedDate get() = when {
updated.isString -> dateFormat.parse(updated.content)?.time ?: 0
else -> (updated.double * 1000).toLong()
}
fun toSManga(baseUrl: String) = SManga.create().apply {
url = "/$service/user/$id" // should be /server/ for Discord but will be filtered anyway

View File

@ -6,9 +6,9 @@ import generator.ThemeSourceGenerator
class KemonoGenerator : ThemeSourceGenerator {
override val themeClass = "Kemono"
override val themePkg = "kemono"
override val baseVersionCode = 1
override val baseVersionCode = 2
override val sources = listOf(
SingleLang("Kemono", "https://kemono.party", "all", isNsfw = true, className = "KemonoParty", pkgName = "kemono"),
SingleLang("Kemono", "https://kemono.party", "all", isNsfw = true),
SingleLang("Coomer", "https://coomer.party", "all", isNsfw = true)
)