slight tweaks to teamx (#14785)

This commit is contained in:
Carlos 2023-01-03 09:07:27 -05:00 committed by GitHub
parent a6f8321858
commit 4d3dccfe10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,6 +150,8 @@ class TeamX : ParsedHttpSource() {
return allChapters return allChapters
} }
val chapterFormat = SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault())
override fun chapterListSelector() = "div.eplister ul a" override fun chapterListSelector() = "div.eplister ul a"
override fun chapterFromElement(element: Element): SChapter { override fun chapterFromElement(element: Element): SChapter {
@ -169,24 +171,22 @@ class TeamX : ParsedHttpSource() {
} }
} }
private fun parseChapterDate(date: String): Long { private fun parseChapterDate(date: String): Long {
return kotlin.runCatching { return kotlin.runCatching {
SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).parse(date)?.time chapterFormat.parse(date)?.time
} }.getOrNull() ?: 0
.getOrNull() ?: 0
} }
// Pages // Pages
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select("div.image_list img").mapIndexed { i, img -> return document.select("div.image_list img").mapIndexed { i, img ->
Page( Page(i, "", img.absUrl("src"))
i,
"",
img.absUrl("src")
)
} }
} }
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
} }