Adding a manga type for j2k library filters (to sources: comx, libmanga, mangachan, mintmanga, readmanga) (#3067)

* Add Russian types of manga

* Mangalib refactoring

Co-authored-by: Pavel Mosein <p.mosein@edadeal.ru>
This commit is contained in:
Eugene 2020-05-09 20:31:28 +05:00 committed by GitHub
parent 7cfd2858c9
commit 252d72c204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 11 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: ComX'
pkgNameSuffix = 'ru.comx'
extClass = '.ComX'
extVersionCode = 5
extVersionCode = 6
libVersion = '1.2'
}

View File

@ -109,7 +109,7 @@ class ComX : ParsedHttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("p:eq(2)").text().removePrefix("Издатель: ")
manga.genre = infoElement.select("p:eq(3)").text()
.removePrefix("Жанр: ")
.removePrefix("Жанр: ").split(",").plusElement("Комикс").joinToString { it.trim() }
manga.status = parseStatus(infoElement.select("p:eq(4)").text()
.removePrefix("Статус: "))

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaLib'
pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga'
extVersionCode = 15
extVersionCode = 16
libVersion = '1.2'
}

View File

@ -179,11 +179,20 @@ class LibManga : ConfigurableSource, HttpSource() {
override fun mangaDetailsParse(response: Response): SManga {
val document = response.asJsoup()
val manga = SManga.create()
if (document.html().contains("Манга удалена по просьбе правообладателей")) {
manga.status = SManga.LICENSED
return manga
}
val body = document.select("div.section__body").first()
val rawCategory = body.select(".info-list__row:has(strong:contains(Тип)) > span").text()
val category = when {
rawCategory == "Комикс западный" -> "комикс"
rawCategory.isNotBlank() -> rawCategory.toLowerCase()
else -> "манга"
}
val genres = body.select(".info-list__row:has(strong:contains(Жанры)) > a").text()
manga.title = document.select(".manga-title small").text().substringBefore("/").trim()
manga.thumbnail_url = body.select(".manga__cover").attr("src")
manga.author = body.select(".info-list__row:nth-child(2) > a").text()
@ -197,7 +206,7 @@ class LibManga : ConfigurableSource, HttpSource() {
"завершен" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
manga.genre = body.select(".info-list__row:has(strong:contains(Жанры)) > a").joinToString { it.text() }
manga.genre = genres.split(",").plusElement(category).joinToString { it.trim() }
manga.description = body.select(".info-desc__content").text()
return manga
}

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mangachan'
pkgNameSuffix = 'ru.mangachan'
extClass = '.Mangachan'
extVersionCode = 8
extVersionCode = 9
libVersion = '1.2'
}

View File

@ -177,10 +177,15 @@ class Mangachan : ParsedHttpSource() {
val infoElement = document.select("table.mangatitle").first()
val descElement = document.select("div#description").first()
val imgElement = document.select("img#cover").first()
val rawCategory = infoElement.select("tr:eq(1) > td:eq(1)").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
} else {
"манга"
}
val manga = SManga.create()
manga.author = infoElement.select("tr:eq(2) > td:eq(1)").text()
manga.genre = infoElement.select("tr:eq(5) > td:eq(1)").text()
manga.genre = infoElement.select("tr:eq(5) > td:eq(1)").text().split(",").plusElement(category).joinToString { it.trim() }
manga.status = parseStatus(infoElement.select("tr:eq(4) > td:eq(1)").text())
manga.description = descElement.textNodes().first().text()
manga.thumbnail_url = imgElement.attr("src")

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga'
extVersionCode = 21
extVersionCode = 22
libVersion = '1.2'
}

View File

@ -98,11 +98,17 @@ class Mintmanga : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select("div.leftContent").first()
val rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
} else {
"манга"
}
val manga = SManga.create()
manga.author = infoElement.select("span.elem_author").first()?.text()
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() }
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement.html())
manga.thumbnail_url = infoElement.select("img").attr("data-full")

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga'
extVersionCode = 18
extVersionCode = 19
libVersion = '1.2'
}

View File

@ -98,11 +98,17 @@ class Readmanga : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select("div.leftContent").first()
val rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
} else {
"манга"
}
val manga = SManga.create()
manga.author = infoElement.select("span.elem_author").first()?.text()
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() }
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement.html())
manga.thumbnail_url = infoElement.select("img").attr("data-full")