From ff635bd624b13eabfea215d459fd49d048328fae Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Wed, 29 Jul 2020 22:49:44 -0400 Subject: [PATCH] Toonkor - fix search (#3952) --- src/ko/toonkor/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ko/toonkor/build.gradle b/src/ko/toonkor/build.gradle index 6265e88a6..a6551def8 100644 --- a/src/ko/toonkor/build.gradle +++ b/src/ko/toonkor/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Toonkor' pkgNameSuffix = 'ko.toonkor' extClass = '.Toonkor' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } diff --git a/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt b/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt index ed848906c..cafbb260d 100644 --- a/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt +++ b/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt @@ -78,10 +78,12 @@ class Toonkor : ConfigurableSource, ParsedHttpSource() { // Search override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val filterList = if (filters.isEmpty()) getFilterList() else filters + // Webtoons, Manga, or Hentai - val type = filters.findUriPartFilter() + val type = filterList.findUriPartFilter() // Popular, Latest, or Completed - val sort = filters.findUriPartFilter() + val sort = filterList.findUriPartFilter() // Hentai doesn't have a "completed" sort, ignore it if it's selected (equivalent to returning popular) val requestPath = when { @@ -129,7 +131,7 @@ class Toonkor : ConfigurableSource, ParsedHttpSource() { private val dateFormat by lazy { SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) } private fun String.toDate(): Long { - return dateFormat.parse(this).time + return dateFormat.parse(this)?.time ?: 0 } // Pages