Fix: Improved date parsing for Keyoapp sites (#7140)

* Fix: Improve date parsing for ReaperScans, StarboundScans, and other Keyoapp sites & fix wrong dates time

* Update version codes

* Update lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt

CamelCase

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>

* Fix: Downgrade override version codes for ReaperScans and StarboundScans

* Fix: Standardize date selector variable naming

* Fix: Correct date format in AstralManga extension

* Fix: enhance relative date parsing & add support for french

* Revert Madara file for another PR and update astralmanga version

---------

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
This commit is contained in:
Aurel 2025-01-13 14:01:38 +01:00 committed by Draff
parent 8d8d46aad1
commit e86d2a850b
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
6 changed files with 9 additions and 7 deletions

View File

@ -2,7 +2,7 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 11
baseVersionCode = 12
dependencies {
api(project(":lib:i18n"))

View File

@ -211,6 +211,7 @@ abstract class Keyoapp(
protected open val authorSelector: String = "div:has(span:containsOwn(Author)) ~ div"
protected open val artistSelector: String = "div:has(span:containsOwn(Artist)) ~ div"
protected open val genreSelector: String = "div:has(span:containsOwn(Type)) ~ div"
protected open val dateSelector: String = ".text-xs"
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
title = document.selectFirst("div.grid > h1")!!.text()
@ -253,7 +254,7 @@ abstract class Keyoapp(
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
setUrlWithoutDomain(element.selectFirst("a[href]")!!.attr("href"))
name = element.selectFirst(".text-sm")!!.text()
element.selectFirst(".text-xs")?.run {
element.selectFirst(dateSelector)?.run {
date_upload = text().trim().parseDate()
}
if (element.select("img[src*=Coin.svg]").isNotEmpty()) {
@ -337,8 +338,6 @@ abstract class Keyoapp(
private fun String.parseRelativeDate(): Long {
val now = Calendar.getInstance().apply {
set(Calendar.HOUR_OF_DAY, 0)
set(Calendar.MINUTE, 0)
set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0)
}

View File

@ -3,7 +3,7 @@ ext {
extClass = '.AstralManga'
themePkg = 'madara'
baseUrl = 'https://astral-manga.fr'
overrideVersionCode = 0
overrideVersionCode = 1
}
apply from: "$rootDir/common.gradle"

View File

@ -4,6 +4,6 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
import java.text.SimpleDateFormat
import java.util.Locale
class AstralManga : Madara("AstralManga", "https://astral-manga.fr", "fr", dateFormat = SimpleDateFormat("dd/mm/yyyy", Locale.FRANCE)) {
class AstralManga : Madara("AstralManga", "https://astral-manga.fr", "fr", dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.FRANCE)) {
override val useNewChapterEndpoint = true
}

View File

@ -9,6 +9,7 @@ class ReaperScans : Keyoapp(
"https://reaper-scans.fr",
"fr",
) {
override val dateSelector = ".text-xs.w-fit"
override fun mangaDetailsParse(document: Document): SManga =
super.mangaDetailsParse(document).apply {

View File

@ -2,4 +2,6 @@ package eu.kanade.tachiyomi.extension.fr.starboundscans
import eu.kanade.tachiyomi.multisrc.keyoapp.Keyoapp
class StarboundScans : Keyoapp("Starbound Scans", "https://starboundscans.com", "fr")
class StarboundScans : Keyoapp("Starbound Scans", "https://starboundscans.com", "fr") {
override val dateSelector = "[class='text-xs text-white/50 w-fit']"
}