Log result in Tsumino and minor code cleanup
This commit is contained in:
parent
72504ca53f
commit
450fcccaa6
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.crashlytics.android.Crashlytics
|
||||
import com.github.salomonbrys.kotson.*
|
||||
import com.google.gson.JsonParser
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
@ -13,6 +14,7 @@ import eu.kanade.tachiyomi.source.model.*
|
||||
import eu.kanade.tachiyomi.source.online.LewdSource
|
||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import eu.kanade.tachiyomi.util.toast
|
||||
import exh.TSUMINO_SOURCE_ID
|
||||
import exh.ui.captcha.CaptchaCompletionVerifier
|
||||
import exh.ui.captcha.SolveCaptchaActivity
|
||||
@ -316,6 +318,7 @@ class Tsumino(private val context: Context): ParsedHttpSource(), LewdSource<Tsum
|
||||
Page(index, chapter.url + "#${index + 1}", newImageUrl.toString())
|
||||
}
|
||||
}.doOnError {
|
||||
try {
|
||||
val aspNetCookie = preferences.eh_ts_aspNetCookie().getOrDefault()
|
||||
|
||||
val cookiesMap = if (aspNetCookie.isNotBlank())
|
||||
@ -328,6 +331,10 @@ class Tsumino(private val context: Context): ParsedHttpSource(), LewdSource<Tsum
|
||||
cookiesMap,
|
||||
CAPTCHA_SCRIPT,
|
||||
"$BASE_URL/Read/Auth/$id")
|
||||
} catch(t: Throwable) {
|
||||
Crashlytics.logException(t)
|
||||
context.toast("Could not launch captcha-solving activity: ${t.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,9 +67,9 @@ class LibraryCategoryAdapter(val view: LibraryCategoryView) :
|
||||
}
|
||||
|
||||
try {
|
||||
val thisCache = globalSearchCache.getOrPut(view.category.name, {
|
||||
val thisCache = globalSearchCache.getOrPut(view.category.name) {
|
||||
SearchCache(mangas.size)
|
||||
})
|
||||
}
|
||||
|
||||
if(thisCache.ready) {
|
||||
//Skip everything if cache matches our query exactly
|
||||
|
@ -31,9 +31,8 @@ fun Realm.queryMetadataFromManga(manga: Manga,
|
||||
fun Realm.syncMangaIds(mangas: List<LibraryItem>) {
|
||||
Timber.d("--> EH: Begin syncing ${mangas.size} manga IDs...")
|
||||
executeTransaction {
|
||||
mangas.filter {
|
||||
isLewdSource(it.manga.source)
|
||||
}.forEach { manga ->
|
||||
mangas.forEach { manga ->
|
||||
if(isLewdSource(manga.manga.source)) {
|
||||
try {
|
||||
manga.hasMetadata =
|
||||
queryMetadataFromManga(manga.manga).findFirst()?.let { meta ->
|
||||
@ -45,6 +44,7 @@ fun Realm.syncMangaIds(mangas: List<LibraryItem>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Timber.d("--> EH: Finish syncing ${mangas.size} manga IDs!")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user