From 2fd5a9e88350e79f5c63e4c2b655442337661298 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 21 Dec 2020 17:24:35 -0500 Subject: [PATCH] Filter out novels from MAL search results --- .../data/track/myanimelist/MyAnimeListApi.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index 756b5a86a1..cd26b51eee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -73,11 +73,14 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI authClient.newCall(GET(url.toString())).await().use { val responseBody = it.body?.string().orEmpty() val response = json.decodeFromString(responseBody) - response["data"]!!.jsonArray.map { - val node = it.jsonObject["node"]!!.jsonObject - val id = node["id"]!!.jsonPrimitive.int - async { getMangaDetails(id) } - }.awaitAll() + response["data"]!!.jsonArray + .map { data -> data.jsonObject["node"]!!.jsonObject } + .map { node -> + val id = node["id"]!!.jsonPrimitive.int + async { getMangaDetails(id) } + } + .awaitAll() + .filter { trackSearch -> trackSearch.publishing_type != "novel" } } } }