From ab9c57882b0d70d28319db62f2ed3a9944411867 Mon Sep 17 00:00:00 2001 From: LordUTF8 <72078107+LordUTF8@users.noreply.github.com> Date: Thu, 1 Oct 2020 05:03:45 +0200 Subject: [PATCH] Fix for thumbnails loading (#4467) * Fix for thumbnails loading * Increment Version Co-authored-by: DF-Aces --- src/fr/japscan/build.gradle | 2 +- .../kanade/tachiyomi/extension/fr/japscan/Japscan.kt | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/fr/japscan/build.gradle b/src/fr/japscan/build.gradle index 8b9647dfb..9ddf7a30a 100644 --- a/src/fr/japscan/build.gradle +++ b/src/fr/japscan/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Japscan' pkgNameSuffix = 'fr.japscan' extClass = '.Japscan' - extVersionCode = 22 + extVersionCode = 23 libVersion = '1.2' } diff --git a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt index 75d58729e..d7814dce2 100644 --- a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt +++ b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt @@ -1,11 +1,13 @@ package eu.kanade.tachiyomi.extension.fr.japscan import android.annotation.SuppressLint +import android.annotation.TargetApi import android.app.Application import android.content.SharedPreferences import android.graphics.Bitmap import android.graphics.Canvas import android.net.Uri +import android.os.Build import android.os.Handler import android.os.Looper import android.support.v7.preference.ListPreference @@ -187,12 +189,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() { element.select("a").first().let { manga.setUrlWithoutDomain(it.attr("href")) manga.title = it.text() - - val s = StringUtils.stripAccents(it.text()) - .replace("[\\W]".toRegex(), "-") - .replace("[-]{2,}".toRegex(), "-") - .replace("^-|-$".toRegex(), "") - manga.thumbnail_url = "$baseUrl/imgs/mangas/$s.jpg".toLowerCase(Locale.ROOT) + manga.thumbnail_url = "$baseUrl/imgs/${it.attr("href").replace(Regex("/$"),".jpg")}".toLowerCase(Locale.ROOT) } return manga } @@ -357,6 +354,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() { webview.settings.javaScriptEnabled = true webview.settings.domStorageEnabled = true webview.webViewClient = object : WebViewClient() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) override fun shouldInterceptRequest( view: WebView, request: WebResourceRequest