From 28be79bba235b4f863131dcc4efb8915dac051c6 Mon Sep 17 00:00:00 2001 From: e-shl <35057681+e-shl@users.noreply.github.com> Date: Wed, 16 Mar 2022 22:17:14 +0500 Subject: [PATCH] [RU]Manga/Hentailib name correct (#11144) * [RU]Manga/Hentailib name correct * option correct --- src/ru/libhentai/build.gradle | 2 +- .../kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt | 8 ++++++-- src/ru/libmanga/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt | 8 ++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ru/libhentai/build.gradle b/src/ru/libhentai/build.gradle index b19cabb29..f2df3e63c 100644 --- a/src/ru/libhentai/build.gradle +++ b/src/ru/libhentai/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'HentaiLib' pkgNameSuffix = 'ru.libhentai' extClass = '.LibHentai' - extVersionCode = 8 + extVersionCode = 9 isNsfw = true } diff --git a/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt b/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt index e41621279..95fb1b998 100644 --- a/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt +++ b/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt @@ -170,7 +170,11 @@ class LibHentai : ConfigurableSource, HttpSource() { private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply { val slug = el.jsonObject["slug"]!!.jsonPrimitive.content val cover = el.jsonObject["cover"]!!.jsonPrimitive.content - title = if (isEng.equals("rus")) el.jsonObject["rus_name"]!!.jsonPrimitive.content else el.jsonObject["name"]!!.jsonPrimitive.content + title = when { + 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 + else -> el.jsonObject["name"]!!.jsonPrimitive.content + } thumbnail_url = "$COVER_URL/huploads/cover/$slug/cover/${cover}_250x350.jpg" url = "/$slug" } @@ -900,7 +904,7 @@ class LibHentai : ConfigurableSource, HttpSource() { val titleLanguagePref = ListPreference(screen.context).apply { key = LANGUAGE_PREF title = LANGUAGE_PREF_Title - entries = arrayOf("Английский (транскрипция)", "Русский") + entries = arrayOf("Английский", "Русский") entryValues = arrayOf("eng", "rus") summary = "%s" setDefaultValue("eng") diff --git a/src/ru/libmanga/build.gradle b/src/ru/libmanga/build.gradle index 3b1fdfda0..5304e64b6 100644 --- a/src/ru/libmanga/build.gradle +++ b/src/ru/libmanga/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaLib' pkgNameSuffix = 'ru.libmanga' extClass = '.LibManga' - extVersionCode = 64 + extVersionCode = 65 } dependencies { diff --git a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt index 0ea1df318..1d76ab444 100644 --- a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt +++ b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt @@ -163,7 +163,11 @@ class LibManga : ConfigurableSource, HttpSource() { private fun popularMangaFromElement(el: JsonElement) = SManga.create().apply { val slug = el.jsonObject["slug"]!!.jsonPrimitive.content val cover = el.jsonObject["cover"]!!.jsonPrimitive.content - title = if (isEng.equals("rus")) el.jsonObject["rus_name"]!!.jsonPrimitive.content else el.jsonObject["name"]!!.jsonPrimitive.content + title = when { + 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 + else -> el.jsonObject["name"]!!.jsonPrimitive.content + } thumbnail_url = "$COVER_URL/uploads/cover/$slug/cover/${cover}_250x350.jpg" url = "/$slug" } @@ -860,7 +864,7 @@ class LibManga : ConfigurableSource, HttpSource() { val titleLanguagePref = ListPreference(screen.context).apply { key = LANGUAGE_PREF title = LANGUAGE_PREF_Title - entries = arrayOf("Английский (транскрипция)", "Русский") + entries = arrayOf("Английский", "Русский") entryValues = arrayOf("eng", "rus") summary = "%s" setDefaultValue("eng")