Fix for thumbnails loading (#4467)

* Fix for thumbnails loading

* Increment Version

Co-authored-by: DF-Aces <johanbaker98gmail.com>
This commit is contained in:
LordUTF8 2020-10-01 05:03:45 +02:00 committed by GitHub
parent 6c66a78a8c
commit ab9c57882b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Japscan' extName = 'Japscan'
pkgNameSuffix = 'fr.japscan' pkgNameSuffix = 'fr.japscan'
extClass = '.Japscan' extClass = '.Japscan'
extVersionCode = 22 extVersionCode = 23
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -1,11 +1,13 @@
package eu.kanade.tachiyomi.extension.fr.japscan package eu.kanade.tachiyomi.extension.fr.japscan
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.Canvas import android.graphics.Canvas
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.support.v7.preference.ListPreference import android.support.v7.preference.ListPreference
@ -187,12 +189,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
element.select("a").first().let { element.select("a").first().let {
manga.setUrlWithoutDomain(it.attr("href")) manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.text() manga.title = it.text()
manga.thumbnail_url = "$baseUrl/imgs/${it.attr("href").replace(Regex("/$"),".jpg")}".toLowerCase(Locale.ROOT)
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)
} }
return manga return manga
} }
@ -357,6 +354,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
webview.settings.javaScriptEnabled = true webview.settings.javaScriptEnabled = true
webview.settings.domStorageEnabled = true webview.settings.domStorageEnabled = true
webview.webViewClient = object : WebViewClient() { webview.webViewClient = object : WebViewClient() {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun shouldInterceptRequest( override fun shouldInterceptRequest(
view: WebView, view: WebView,
request: WebResourceRequest request: WebResourceRequest