[RU]LibManga fix load cover (#9462)
* [RU]LibManga fix load cover * capitalize tag
This commit is contained in:
parent
64ba1e6ba4
commit
cc792ccfb1
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'MangaLib'
|
extName = 'MangaLib'
|
||||||
pkgNameSuffix = 'ru.libmanga'
|
pkgNameSuffix = 'ru.libmanga'
|
||||||
extClass = '.LibManga'
|
extClass = '.LibManga'
|
||||||
extVersionCode = 54
|
extVersionCode = 55
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -87,8 +87,7 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
private fun latestUpdatesFromElement(element: Element): SManga {
|
private fun latestUpdatesFromElement(element: Element): SManga {
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
element.select("div.cover").first().let { img ->
|
element.select("div.cover").first().let { img ->
|
||||||
manga.thumbnail_url = baseUrl + img.attr("data-src").substringAfter(baseUrl)
|
manga.thumbnail_url = img.attr("data-src").replace("_thumb", "_250x350")
|
||||||
.replace("_thumb", "_250x350")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
element.select("a").first().let { link ->
|
element.select("a").first().let { link ->
|
||||||
|
@ -149,7 +148,7 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
val slug = el["slug"].string
|
val slug = el["slug"].string
|
||||||
val cover = el["cover"].string
|
val cover = el["cover"].string
|
||||||
title = el["name"].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"
|
url = "/$slug"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,9 +163,9 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
val body = document.select("div.media-info-list").first()
|
val body = document.select("div.media-info-list").first()
|
||||||
val rawCategory = body.select("div.media-info-list__title:contains(Тип) + div").text()
|
val rawCategory = body.select("div.media-info-list__title:contains(Тип) + div").text()
|
||||||
val category = when {
|
val category = when {
|
||||||
rawCategory == "Комикс западный" -> "комикс"
|
rawCategory == "Комикс западный" -> "Комикс"
|
||||||
rawCategory.isNotBlank() -> rawCategory.toLowerCase(Locale.ROOT)
|
rawCategory.isNotBlank() -> rawCategory
|
||||||
else -> "манга"
|
else -> "Манга"
|
||||||
}
|
}
|
||||||
var rawAgeStop = body.select("div.media-info-list__title:contains(Возрастной рейтинг) + div").text()
|
var rawAgeStop = body.select("div.media-info-list__title:contains(Возрастной рейтинг) + div").text()
|
||||||
if (rawAgeStop.isEmpty()) {
|
if (rawAgeStop.isEmpty()) {
|
||||||
|
@ -188,7 +187,7 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
ratingValue > 0.5 -> "✬☆☆☆☆"
|
ratingValue > 0.5 -> "✬☆☆☆☆"
|
||||||
else -> "☆☆☆☆☆"
|
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.title = document.select(".media-name__alt").text()
|
||||||
manga.thumbnail_url = document.select(".media-sidebar__cover > img").attr("src").substringAfter(baseOrig)
|
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()
|
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 = "MangaLibDomain"
|
||||||
private const val DOMAIN_PREF_Title = "Выбор домена"
|
private const val DOMAIN_PREF_Title = "Выбор домена"
|
||||||
|
|
||||||
|
private const val COVER_URL = "https://staticlib.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
private var server: String? = preferences.getString(SERVER_PREF, null)
|
private var server: String? = preferences.getString(SERVER_PREF, null)
|
||||||
|
|
Loading…
Reference in New Issue