From 1db874f857424f1d09d7c5d9a0689bd6aea9904d Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Thu, 13 Aug 2020 03:06:10 -0400 Subject: [PATCH] Henchan - fix cover not being set by mangaDetailsParse (#4103) --- src/ru/henchan/build.gradle | 3 ++- .../eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ru/henchan/build.gradle b/src/ru/henchan/build.gradle index 27d798623..1afa97e94 100644 --- a/src/ru/henchan/build.gradle +++ b/src/ru/henchan/build.gradle @@ -5,8 +5,9 @@ ext { extName = 'Henchan' pkgNameSuffix = 'ru.henchan' extClass = '.Henchan' - extVersionCode = 16 + extVersionCode = 17 libVersion = '1.2' + containsNsfw = true } dependencies { diff --git a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt index 7a5939f4b..31e2ceca1 100644 --- a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt +++ b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt @@ -1,11 +1,13 @@ package eu.kanade.tachiyomi.extension.ru.henchan +import android.annotation.SuppressLint import com.github.salomonbrys.kotson.array import com.github.salomonbrys.kotson.fromJson import com.github.salomonbrys.kotson.string import com.google.gson.Gson import com.google.gson.JsonArray import com.google.gson.JsonObject +import eu.kanade.tachiyomi.annotations.Nsfw import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.Filter @@ -26,6 +28,7 @@ import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element +@Nsfw class Henchan : ParsedHttpSource() { override val name = "Henchan" @@ -133,6 +136,7 @@ class Henchan : ParsedHttpSource() { manga.author = document.select(".row .item2 h2")[1].text() manga.genre = document.select(".sidetag > a:eq(2)").joinToString { it.text() } manga.description = document.select("#description").text() + manga.thumbnail_url = document.select("img#cover").attr("abs:src").getHQThumbnail() return manga } @@ -159,7 +163,7 @@ class Henchan : ParsedHttpSource() { chap.chapter_number = 1F val date = document.select("div.row4_right b")?.text()?.let { - SimpleDateFormat("dd MMMM yyyy", Locale("ru")).parse(it).time + SimpleDateFormat("dd MMMM yyyy", Locale("ru")).parse(it)?.time ?: 0 } ?: 0 chap.date_upload = date return listOf(chap) @@ -236,7 +240,7 @@ class Henchan : ParsedHttpSource() { } } - private class Genre(val id: String, name: String = id.replace('_', ' ').capitalize()) : Filter.TriState(name) + private class Genre(val id: String, @SuppressLint("DefaultLocale") name: String = id.replace('_', ' ').capitalize()) : Filter.TriState(name) private class GenreList(genres: List) : Filter.Group("Тэги", genres) private class OrderBy : UriPartFilter("Сортировка", arrayOf("Дата", "Популярность", "Алфавит"), arrayOf("&n=dateasc" to "", "&n=favasc" to "&n=favdesc", "&n=abcdesc" to "&n=abcasc"),