[RU]LibManga fix load cover (#9462)

* [RU]LibManga fix load cover

* capitalize tag
This commit is contained in:
e-shl 2021-10-13 17:19:16 +05:00 committed by GitHub
parent 64ba1e6ba4
commit cc792ccfb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga'
extVersionCode = 54
extVersionCode = 55
}
apply from: "$rootDir/common.gradle"

View File

@ -87,8 +87,7 @@ class LibManga : ConfigurableSource, HttpSource() {
private fun latestUpdatesFromElement(element: Element): SManga {
val manga = SManga.create()
element.select("div.cover").first().let { img ->
manga.thumbnail_url = baseUrl + img.attr("data-src").substringAfter(baseUrl)
.replace("_thumb", "_250x350")
manga.thumbnail_url = img.attr("data-src").replace("_thumb", "_250x350")
}
element.select("a").first().let { link ->
@ -149,7 +148,7 @@ class LibManga : ConfigurableSource, HttpSource() {
val slug = el["slug"].string
val cover = el["cover"].string
title = el["name"].string
thumbnail_url = "$baseUrl/uploads/cover/$slug/cover/${cover}_250x350.jpg"
thumbnail_url = "$COVER_URL/uploads/cover/$slug/cover/${cover}_250x350.jpg"
url = "/$slug"
}
@ -164,9 +163,9 @@ class LibManga : ConfigurableSource, HttpSource() {
val body = document.select("div.media-info-list").first()
val rawCategory = body.select("div.media-info-list__title:contains(Тип) + div").text()
val category = when {
rawCategory == "Комикс западный" -> "комикс"
rawCategory.isNotBlank() -> rawCategory.toLowerCase(Locale.ROOT)
else -> "манга"
rawCategory == "Комикс западный" -> "Комикс"
rawCategory.isNotBlank() -> rawCategory
else -> "Манга"
}
var rawAgeStop = body.select("div.media-info-list__title:contains(Возрастной рейтинг) + div").text()
if (rawAgeStop.isEmpty()) {
@ -188,7 +187,7 @@ class LibManga : ConfigurableSource, HttpSource() {
ratingValue > 0.5 -> "✬☆☆☆☆"
else -> "☆☆☆☆☆"
}
val genres = document.select(".media-tags > a").map { it.text() }
val genres = document.select(".media-tags > a").map { it.text().capitalize() }
manga.title = document.select(".media-name__alt").text()
manga.thumbnail_url = document.select(".media-sidebar__cover > img").attr("src").substringAfter(baseOrig)
manga.author = body.select("div.media-info-list__title:contains(Автор) + div").text()
@ -778,6 +777,8 @@ class LibManga : ConfigurableSource, HttpSource() {
private const val DOMAIN_PREF = "MangaLibDomain"
private const val DOMAIN_PREF_Title = "Выбор домена"
private const val COVER_URL = "https://staticlib.me"
}
private var server: String? = preferences.getString(SERVER_PREF, null)