comick: fix date (#16628)

This commit is contained in:
AwkwardPeak7 2023-06-06 14:22:17 +05:00 committed by GitHub
parent abd91a3156
commit c6487255fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Comick'
pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory'
extVersionCode = 26
extVersionCode = 27
isNsfw = true
}

View File

@ -25,6 +25,7 @@ import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.TimeZone
abstract class ComickFun(
override val lang: String,
@ -314,7 +315,9 @@ abstract class ComickFun(
companion object {
const val SLUG_SEARCH_PREFIX = "id:"
val dateFormat by lazy {
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH)
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH).apply {
timeZone = TimeZone.getTimeZone("UTC")
}
}
val markdownLinksRegex = "\\[([^]]+)\\]\\(([^)]+)\\)".toRegex()
val markdownItalicBoldRegex = "\\*+\\s*([^\\*]*)\\s*\\*+".toRegex()

View File

@ -100,7 +100,7 @@ data class Chapter(
val hid: String,
val lang: String,
val title: String = "",
val updated_at: String = "",
val created_at: String = "",
val chap: String = "",
val vol: String = "",
val group_name: List<String> = emptyList(),
@ -108,7 +108,7 @@ data class Chapter(
fun toSChapter(mangaUrl: String) = SChapter.create().apply {
url = "$mangaUrl/$hid-chapter-$chap-$lang"
name = beautifyChapterName(vol, chap, title)
date_upload = updated_at.parseDate()
date_upload = created_at.parseDate()
scanlator = group_name.joinToString().takeUnless { it.isBlank() } ?: "Unknown"
}
}