diff --git a/multisrc/overrides/heancms/reaperscans/src/ReaperScans.kt b/multisrc/overrides/heancms/reaperscans/src/ReaperScans.kt index 6f40d3661..b631c6a3a 100644 --- a/multisrc/overrides/heancms/reaperscans/src/ReaperScans.kt +++ b/multisrc/overrides/heancms/reaperscans/src/ReaperScans.kt @@ -5,6 +5,8 @@ import eu.kanade.tachiyomi.multisrc.heancms.HeanCms import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient +import java.text.SimpleDateFormat +import java.util.TimeZone class ReaperScans : HeanCms( "Reaper Scans", @@ -21,6 +23,10 @@ class ReaperScans : HeanCms( override val coverPath: String = "" + override val dateFormat: SimpleDateFormat = super.dateFormat.apply { + timeZone = TimeZone.getTimeZone("GMT+01:00") + } + override fun getGenreList(): List = listOf( Genre("Artes Marciais", 2), Genre("Aventura", 10), diff --git a/multisrc/overrides/heancms/yugenmangas/src/YugenMangas.kt b/multisrc/overrides/heancms/yugenmangas/src/YugenMangas.kt index ce6ece048..241bff948 100644 --- a/multisrc/overrides/heancms/yugenmangas/src/YugenMangas.kt +++ b/multisrc/overrides/heancms/yugenmangas/src/YugenMangas.kt @@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.extension.es.yugenmangas import eu.kanade.tachiyomi.multisrc.heancms.Genre import eu.kanade.tachiyomi.multisrc.heancms.HeanCms +import java.text.SimpleDateFormat +import java.util.TimeZone class YugenMangas : HeanCms("YugenMangas", "https://yugenmangas.com", "es") { @@ -10,6 +12,10 @@ class YugenMangas : HeanCms("YugenMangas", "https://yugenmangas.com", "es") { override val coverPath: String = "" + override val dateFormat: SimpleDateFormat = super.dateFormat.apply { + timeZone = TimeZone.getTimeZone("UTC") + } + override fun getGenreList(): List = listOf( Genre("+18", 1), Genre("Acción", 36), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCms.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCms.kt index 245326766..f0c28819e 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCms.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCms.kt @@ -21,6 +21,8 @@ import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response import rx.Observable import uy.kohesive.injekt.injectLazy +import java.text.SimpleDateFormat +import java.util.Locale abstract class HeanCms( override val name: String, @@ -41,6 +43,8 @@ abstract class HeanCms( protected open val coverPath: String = "cover/" + protected open val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", Locale.US) + private var seriesSlugMap: Map? = null override fun headersBuilder(): Headers.Builder = Headers.Builder() @@ -235,7 +239,7 @@ abstract class HeanCms( val currentTimestamp = System.currentTimeMillis() return result.chapters.orEmpty() - .map { it.toSChapter(seriesSlug) } + .map { it.toSChapter(seriesSlug, dateFormat) } .filter { it.date_upload <= currentTimestamp } .reversed() } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsDto.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsDto.kt index f87f9f22c..26578e6a0 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsDto.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsDto.kt @@ -6,7 +6,6 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import org.jsoup.Jsoup import java.text.SimpleDateFormat -import java.util.Locale @Serializable data class HeanCmsQuerySearchDto( @@ -94,18 +93,12 @@ data class HeanCmsChapterDto( @SerialName("created_at") val createdAt: String, ) { - fun toSChapter(seriesSlug: String): SChapter = SChapter.create().apply { + fun toSChapter(seriesSlug: String, dateFormat: SimpleDateFormat): SChapter = SChapter.create().apply { name = this@HeanCmsChapterDto.name.trim() - date_upload = runCatching { DATE_FORMAT.parse(createdAt.substringBefore("."))?.time } + date_upload = runCatching { dateFormat.parse(createdAt)?.time } .getOrNull() ?: 0L url = "/series/$seriesSlug/$slug#$id" } - - companion object { - private val DATE_FORMAT by lazy { - SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US) - } - } } @Serializable diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsGenerator.kt index 15f9c6a9e..ddbfc458f 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/heancms/HeanCmsGenerator.kt @@ -9,7 +9,7 @@ class HeanCmsGenerator : ThemeSourceGenerator { override val themeClass = "HeanCms" - override val baseVersionCode: Int = 8 + override val baseVersionCode: Int = 9 override val sources = listOf( SingleLang("Reaper Scans", "https://reaperscans.net", "pt-BR", overrideVersionCode = 35),