mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Filter out novels from MAL search results
This commit is contained in:
		| @@ -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<JsonObject>(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" } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user