From e1f897f6c8b95fc442e347c02622c72dc617caeb Mon Sep 17 00:00:00 2001 From: are-are-are <62763969+dejavui@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:07:35 +0700 Subject: [PATCH] MeituaTop: Fix chapter not found for Suwayomi users (#6191) Add parseDate --- src/all/meituatop/build.gradle | 2 +- .../kanade/tachiyomi/extension/all/meituatop/MeituaTop.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/all/meituatop/build.gradle b/src/all/meituatop/build.gradle index 4eb5c0c35..9f02ad7e8 100644 --- a/src/all/meituatop/build.gradle +++ b/src/all/meituatop/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Meitua.top' extClass = '.MeituaTop' - extVersionCode = 7 + extVersionCode = 8 isNsfw = true } diff --git a/src/all/meituatop/src/eu/kanade/tachiyomi/extension/all/meituatop/MeituaTop.kt b/src/all/meituatop/src/eu/kanade/tachiyomi/extension/all/meituatop/MeituaTop.kt index fc9f653a9..3c1664627 100644 --- a/src/all/meituatop/src/eu/kanade/tachiyomi/extension/all/meituatop/MeituaTop.kt +++ b/src/all/meituatop/src/eu/kanade/tachiyomi/extension/all/meituatop/MeituaTop.kt @@ -76,12 +76,16 @@ class MeituaTop : HttpSource() { val chapter = SChapter.create().apply { url = manga.url name = "Gallery" - date_upload = dateFormat.parse(manga.description!!)!!.time + date_upload = parseDate(manga.description!!) chapter_number = -2f } return Observable.just(listOf(chapter)) } + private fun parseDate(date: String): Long = runCatching { + dateFormat.parse(date)?.time + }.getOrNull() ?: 0L + override fun chapterListParse(response: Response) = throw UnsupportedOperationException() override fun pageListParse(response: Response): List {