[RU]Lib cover thumbnail_url (#11390)

This commit is contained in:
e-shl 2022-04-09 00:05:58 +05:00 committed by GitHub
parent 905d12da4c
commit be672522da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 12 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'HentaiLib' extName = 'HentaiLib'
pkgNameSuffix = 'ru.libhentai' pkgNameSuffix = 'ru.libhentai'
extClass = '.LibHentai' extClass = '.LibHentai'
extVersionCode = 10 extVersionCode = 11
isNsfw = true isNsfw = true
} }

View File

@ -110,7 +110,7 @@ class LibHentai : 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 = img.attr("data-src").replace("_thumb", "_250x350") manga.thumbnail_url = baseUrl + img.attr("data-src").replace("_thumb", "_250x350")
} }
element.select("a").first().let { link -> element.select("a").first().let { link ->
@ -168,15 +168,13 @@ class LibHentai : ConfigurableSource, HttpSource() {
} }
private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply { private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply {
val slug = el.jsonObject["slug"]!!.jsonPrimitive.content
val cover = el.jsonObject["cover"]!!.jsonPrimitive.content
title = when { title = when {
isEng.equals("rus") && el.jsonObject["rus_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["rus_name"]!!.jsonPrimitive.content isEng.equals("rus") && el.jsonObject["rus_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["rus_name"]!!.jsonPrimitive.content
isEng.equals("eng") && el.jsonObject["eng_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["eng_name"]!!.jsonPrimitive.content isEng.equals("eng") && el.jsonObject["eng_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["eng_name"]!!.jsonPrimitive.content
else -> el.jsonObject["name"]!!.jsonPrimitive.content else -> el.jsonObject["name"]!!.jsonPrimitive.content
} }
thumbnail_url = "$COVER_URL/huploads/cover/$slug/cover/${cover}_250x350.jpg" thumbnail_url = baseUrl + el.jsonObject["covers"]!!.jsonObject["default"]!!.jsonPrimitive.content
url = "/$slug" url = "/" + el.jsonObject["slug"]!!.jsonPrimitive.content
} }
override fun mangaDetailsParse(response: Response): SManga { override fun mangaDetailsParse(response: Response): SManga {

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaLib' extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga' pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga' extClass = '.LibManga'
extVersionCode = 66 extVersionCode = 67
} }
dependencies { dependencies {

View File

@ -103,7 +103,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 = img.attr("data-src").replace("_thumb", "_250x350") manga.thumbnail_url = baseUrl + img.attr("data-src").replace("_thumb", "_250x350")
} }
element.select("a").first().let { link -> element.select("a").first().let { link ->
@ -161,15 +161,13 @@ class LibManga : ConfigurableSource, HttpSource() {
} }
private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply { private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply {
val slug = el.jsonObject["slug"]!!.jsonPrimitive.content
val cover = el.jsonObject["cover"]!!.jsonPrimitive.content
title = when { title = when {
isEng.equals("rus") && el.jsonObject["rus_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["rus_name"]!!.jsonPrimitive.content isEng.equals("rus") && el.jsonObject["rus_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["rus_name"]!!.jsonPrimitive.content
isEng.equals("eng") && el.jsonObject["eng_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["eng_name"]!!.jsonPrimitive.content isEng.equals("eng") && el.jsonObject["eng_name"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() -> el.jsonObject["eng_name"]!!.jsonPrimitive.content
else -> el.jsonObject["name"]!!.jsonPrimitive.content else -> el.jsonObject["name"]!!.jsonPrimitive.content
} }
thumbnail_url = "$COVER_URL/uploads/cover/$slug/cover/${cover}_250x350.jpg" thumbnail_url = baseUrl + el.jsonObject["covers"]!!.jsonObject["default"]!!.jsonPrimitive.content
url = "/$slug" url = "/" + el.jsonObject["slug"]!!.jsonPrimitive.content
} }
override fun mangaDetailsParse(response: Response): SManga { override fun mangaDetailsParse(response: Response): SManga {