Merge pull request #492 from Pavkazzz/com-x

Com x
This commit is contained in:
Carlos 2018-09-15 07:02:01 -04:00 committed by GitHub
commit 4dd1719cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -5,9 +5,9 @@ ext {
appName = 'Tachiyomi: ComX' appName = 'Tachiyomi: ComX'
pkgNameSuffix = 'ru.comx' pkgNameSuffix = 'ru.comx'
extClass = '.ComX' extClass = '.ComX'
extVersionCode = 1 extVersionCode = 2
extVersionSuffix = 1 extVersionSuffix = 2
libVersion = '1.0' libVersion = '1.2'
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -37,7 +37,7 @@ class ComX : ParsedHttpSource() {
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
manga.thumbnail_url = baseUrl + element.select("img").first().attr("src") manga.thumbnail_url = baseUrl + element.select("img").first().attr("src")
element.select("a").first().let { element.select("div.info-poster1 a").first().let {
manga.setUrlWithoutDomain(it.attr("href")) manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.text() manga.title = it.text()
} }
@ -90,9 +90,10 @@ class ComX : ParsedHttpSource() {
val text = infoElement.select("*").text() val text = infoElement.select("*").text()
if (!text.contains("Добавить описание на комикс")) { if (!text.contains("Добавить описание на комикс")) {
manga.description = text val fromRemove = "Отслеживать"
.removeRange(0, text.indexOf("Отслеживать")) val toRemove = "Читать комикс"
.removeRange(text.indexOf("Читать комикс"), text.length) val desc = text.removeRange(0, text.indexOf(fromRemove)+fromRemove.length)
manga.description = desc.removeRange(desc.indexOf(toRemove)+toRemove.length, desc.length)
} }
val src = infoElement.select("img").attr("src") val src = infoElement.select("img").attr("src")