odd extension search error fix
This commit is contained in:
parent
d4c2df37ae
commit
ba351df331
3 changed files with 9 additions and 3 deletions
|
@ -39,6 +39,7 @@ import eu.kanade.tachiyomi.source.model.Page
|
|||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.lang.awaitSingle
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
|
@ -163,7 +164,7 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() {
|
|||
extension.sources[sourceLanguage]
|
||||
} as? AnimeCatalogueSource ?: return emptyList()
|
||||
return try {
|
||||
val res = source.fetchSearchAnime(1, query, AnimeFilterList()).toBlocking().first()
|
||||
val res = source.fetchSearchAnime(0, query, source.getFilterList()).awaitSingle()
|
||||
convertAnimesPageToShowResponse(res)
|
||||
} catch (e: CloudflareBypassException) {
|
||||
logger("Exception in search: $e")
|
||||
|
@ -462,7 +463,7 @@ class DynamicMangaParser(extension: MangaExtension.Installed) : MangaParser() {
|
|||
} as? HttpSource ?: return emptyList()
|
||||
|
||||
return try {
|
||||
val res = source.fetchSearchManga(1, query, FilterList()).toBlocking().first()
|
||||
val res = source.fetchSearchManga(1, query, source.getFilterList()).awaitSingle()
|
||||
logger("res observable: $res")
|
||||
convertMangasPageToShowResponse(res)
|
||||
} catch (e: CloudflareBypassException) {
|
||||
|
|
|
@ -55,7 +55,12 @@ abstract class BaseParser {
|
|||
saveShowResponse(mediaObj.id, response, true)
|
||||
} else {
|
||||
setUserText("Searching : ${mediaObj.mainName()}")
|
||||
logger("Searching : ${mediaObj.mainName()}")
|
||||
val results = search(mediaObj.mainName())
|
||||
//log all results
|
||||
results.forEach {
|
||||
logger("Result: ${it.name}")
|
||||
}
|
||||
val sortedResults = if (results.isNotEmpty()) {
|
||||
results.sortedByDescending { FuzzySearch.ratio(it.name.lowercase(), mediaObj.mainName().lowercase()) }
|
||||
} else {
|
||||
|
@ -65,6 +70,7 @@ abstract class BaseParser {
|
|||
|
||||
if (response == null || FuzzySearch.ratio(response.name.lowercase(), mediaObj.mainName().lowercase()) < 100) {
|
||||
setUserText("Searching : ${mediaObj.nameRomaji}")
|
||||
logger("Searching : ${mediaObj.nameRomaji}")
|
||||
val romajiResults = search(mediaObj.nameRomaji)
|
||||
val sortedRomajiResults = if (romajiResults.isNotEmpty()) {
|
||||
romajiResults.sortedByDescending { FuzzySearch.ratio(it.name.lowercase(), mediaObj.nameRomaji.lowercase()) }
|
||||
|
|
|
@ -30,7 +30,6 @@ abstract class WatchSources : BaseSources() {
|
|||
extra: Map<String, String>?,
|
||||
sAnime: SAnime?
|
||||
): MutableMap<String, Episode> {
|
||||
println("finder333 $showLink")
|
||||
val map = mutableMapOf<String, Episode>()
|
||||
val parser = get(i)
|
||||
tryWithSuspend(true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue