uk/MangaInUa (#16600)

fix showing genre, chapter name, chapter number , status

Co-authored-by: Oleh Mykhalskyi <mykhalskyi11@gmail.com>
This commit is contained in:
Oleh Mykhalskyi 2023-06-06 09:22:38 +00:00 committed by GitHub
parent c6487255fb
commit 64ac44dff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaInUa'
pkgNameSuffix = 'uk.mangainua'
extClass = '.Mangainua'
extVersionCode = 2
extVersionCode = 3
isNsfw = true
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -97,18 +97,46 @@ class Mangainua : ParsedHttpSource() {
return SManga.create().apply {
title = document.select("span.UAname").text()
description = document.select("div.item__full-description").text()
genre = document.select("div.item__full-sideba--header:eq(4) span").first()!!.select("a").joinToString { it.text() }
thumbnail_url = document.select("div.item__full-sidebar--poster img").first()!!.attr("abs:src")
status = when (document.select("div.item__full-sideba--header:has(div:containsOwn(Статус перекладу:))").first()?.select("span.item__full-sidebar--description")?.first()?.text()) {
"Триває" -> SManga.ONGOING
"Покинуто" -> SManga.CANCELLED
"Закінчений" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
val type = when (document.select("div.item__full-sideba--header:has(div:containsOwn(Тип:))").first()?.select("span.item__full-sidebar--description")?.first()!!.text()) {
"ВЕБМАНХВА" -> "Manhwa"
"МАНХВА" -> "Manhwa"
"МАНЬХВА" -> "Manhua"
"ВЕБМАНЬХВА" -> "Manhua"
else -> "Manga"
}
genre = document.select("div.item__full-sideba--header:has(div:containsOwn(Жанри:))").first()?.select("span.item__full-sidebar--description")?.first()!!.select("a").joinToString { it.text() } + ", " + type
}
}
// Chapters
override fun chapterListSelector() = "div.ltcitems"
private var previousChapterName: String? = null
private var previousChapterNumber: Float = 0.0f
override fun chapterFromElement(element: Element): SChapter {
return SChapter.create().apply {
element.select("a").let { urlElement ->
setUrlWithoutDomain(urlElement.attr("href"))
name = urlElement.text().substringAfter("НОВЕ").trim()
val chapterName = urlElement.text().substringAfter("НОВЕ").trim()
val chapterNumber = urlElement.text().substringAfter("Розділ").substringBefore("-").trim()
if (chapterName.contains("Альтернативний переклад")) {
name = previousChapterName.toString().substringBefore("-").trim()
scanlator = urlElement.text().substringAfter("від:").trim()
chapter_number = previousChapterNumber
} else {
name = chapterName
previousChapterName = chapterName
chapter_number = chapterNumber.toFloat()
previousChapterNumber = chapterNumber.toFloat()
}
}
date_upload = parseDate(element.select("div.ltcright:containsOwn(.)").text())
}