[Com-X] Small changes (#1814)
Co-authored-by: Draken <dragonx943@users.noreply.github.com>
This commit is contained in:
@@ -85,15 +85,26 @@ internal class ComXParser(context: MangaLoaderContext) :
|
||||
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||
return doc.select("div.readed.d-flex.short").map { item ->
|
||||
val a = item.selectFirstOrThrow("a.readed__img.img-fit-cover.anim")
|
||||
val titleElement = item.selectFirstOrThrow("h3.readed__title a")
|
||||
val img = item.selectFirst("img[data-src]")
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val titleElement = item.selectFirstOrThrow("h3.readed__title a")
|
||||
val (mainTitle, altTitle) = titleElement.text()
|
||||
.split("\\s*/\\s*".toRegex())
|
||||
.map { it.trim() }
|
||||
.let { parts ->
|
||||
when {
|
||||
parts.size >= 2 -> parts[1] to parts[0]
|
||||
parts.isNotEmpty() -> parts[0] to ""
|
||||
else -> "" to ""
|
||||
}
|
||||
}
|
||||
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
url = href,
|
||||
publicUrl = a.attrAsAbsoluteUrl("href"),
|
||||
title = titleElement.text(),
|
||||
altTitles = emptySet(),
|
||||
title = mainTitle,
|
||||
altTitles = if (altTitle.isNotEmpty()) setOf(altTitle) else emptySet(),
|
||||
authors = emptySet(),
|
||||
description = null,
|
||||
tags = emptySet(),
|
||||
|
||||
Reference in New Issue
Block a user