From 1d6ed34d77543af21e6bca1eab2d8797e329c08f Mon Sep 17 00:00:00 2001 From: Secozzi <49240133+Secozzi@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:44:42 +0000 Subject: [PATCH] newtoki: fix crash when changing sort filter (#1464) * fix crash when changing sort filter * small touch-up --- src/ko/newtoki/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/ko/newtoki/ManaToki.kt | 3 ++- .../eu/kanade/tachiyomi/extension/ko/newtoki/NewTokiWebtoon.kt | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ko/newtoki/build.gradle b/src/ko/newtoki/build.gradle index 215e2a092..5f3a36658 100644 --- a/src/ko/newtoki/build.gradle +++ b/src/ko/newtoki/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'NewToki / ManaToki' extClass = '.TokiFactory' - extVersionCode = 30 + extVersionCode = 31 isNsfw = true } diff --git a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/ManaToki.kt b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/ManaToki.kt index 62fa94ce4..1d01877bb 100644 --- a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/ManaToki.kt +++ b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/ManaToki.kt @@ -57,7 +57,7 @@ object ManaToki : NewToki("ManaToki", "comic", manaTokiPreferences) { } is SearchSortTypeList -> { - val state = filter.state ?: return@forEach + val state = filter.state!! url.addQueryParameter("sst", arrayOf("wr_datetime", "wr_hit", "wr_good", "as_update")[state.index]) url.addQueryParameter("sod", if (state.ascending) "asc" else "desc") } @@ -161,6 +161,7 @@ object ManaToki : NewToki("ManaToki", "comic", manaTokiPreferences) { "추천순", "업데이트순", ), + Selection(0, false), ) override fun getFilterList() = FilterList( diff --git a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewTokiWebtoon.kt b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewTokiWebtoon.kt index 340f0b306..147e4acc9 100644 --- a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewTokiWebtoon.kt +++ b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewTokiWebtoon.kt @@ -23,7 +23,7 @@ object NewTokiWebtoon : NewToki("NewToki", "webtoon", newTokiPreferences) { } is SearchSortTypeList -> { - val state = filter.state ?: return@forEach + val state = filter.state!! url.addQueryParameter("sst", arrayOf("as_update", "wr_hit", "wr_good")[state.index]) url.addQueryParameter("sod", if (state.ascending) "asc" else "desc") } @@ -132,6 +132,7 @@ object NewTokiWebtoon : NewToki("NewToki", "webtoon", newTokiPreferences) { "인기순", "추천순", ), + Selection(0, false), ) override fun getFilterList() = FilterList(