From fe7559b06f199224fc4a4c48bc818555ef2f5895 Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:14:52 +0500 Subject: [PATCH] xoxo: update url (#16902) * XoXo: update url * fix date parsing --- multisrc/overrides/wpcomics/xoxocomics/src/XoxoComics.kt | 9 ++++++++- .../eu/kanade/tachiyomi/multisrc/wpcomics/WPComics.kt | 2 +- .../tachiyomi/multisrc/wpcomics/WPComicsGenerator.kt | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/multisrc/overrides/wpcomics/xoxocomics/src/XoxoComics.kt b/multisrc/overrides/wpcomics/xoxocomics/src/XoxoComics.kt index 486536cbe..e4922df1d 100644 --- a/multisrc/overrides/wpcomics/xoxocomics/src/XoxoComics.kt +++ b/multisrc/overrides/wpcomics/xoxocomics/src/XoxoComics.kt @@ -13,7 +13,7 @@ import org.jsoup.nodes.Element import java.text.SimpleDateFormat import java.util.Locale -class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.com", "en", SimpleDateFormat("MM/dd/yy", Locale.US), null) { +class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.net", "en", SimpleDateFormat("MM/dd/yyyy", Locale.US), null) { override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/comic-updates?page=$page", headers) override fun latestUpdatesSelector() = "li.row" override fun latestUpdatesFromElement(element: Element): SManga { @@ -43,5 +43,12 @@ class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.com", "en", Simpl parseChapters(response.asJsoup()) return chapters } + + override fun chapterFromElement(element: Element): SChapter { + return super.chapterFromElement(element).apply { + date_upload = element.select("div.col-xs-3").text().toDate() + } + } + override fun pageListRequest(chapter: SChapter): Request = GET(baseUrl + "${chapter.url}/all") } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComics.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComics.kt index 4abb2779a..9ae2c032a 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComics.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComics.kt @@ -153,7 +153,7 @@ abstract class WPComics( private val currentYear by lazy { Calendar.getInstance(Locale.US)[1].toString().takeLast(2) } - private fun String?.toDate(): Long { + protected fun String?.toDate(): Long { this ?: return 0 val secondWords = listOf("second", "giĆ¢y") diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComicsGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComicsGenerator.kt index bdedd362d..e7b22f86f 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComicsGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpcomics/WPComicsGenerator.kt @@ -15,7 +15,7 @@ class WPComicsGenerator : ThemeSourceGenerator { SingleLang("NetTruyen", "https://www.nettruyenmax.com", "vi", overrideVersionCode = 18), SingleLang("NhatTruyen", "https://nhattruyenmin.com", "vi", overrideVersionCode = 11), SingleLang("TruyenChon", "http://truyenchon.com", "vi", overrideVersionCode = 3), - SingleLang("XOXO Comics", "https://xoxocomics.com", "en", className = "XoxoComics", overrideVersionCode = 1), + SingleLang("XOXO Comics", "https://xoxocomics.net", "en", className = "XoxoComics", overrideVersionCode = 2), ) companion object {