From 13bcefe5cd8231a58e95d7c3f61098a786bbe833 Mon Sep 17 00:00:00 2001 From: len Date: Sat, 7 Jan 2017 00:29:52 +0100 Subject: [PATCH] Filter manga library entries in Kitsu --- .../java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt index 12d6de5b45..e524ef705c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt @@ -88,8 +88,10 @@ class KitsuApi(private val client: OkHttpClient, interceptor: KitsuInterceptor) fun findLibManga(track: Track, userId: String): Observable { return rest.findLibManga(track.remote_id, userId) .map { json -> - val data = json["data"].array - if (data.size() > 0) { + val data = json["data"].array.filter { + it["relationships"]["media"]["data"]["type"].string == "manga" + } + if (data.isNotEmpty()) { KitsuLibManga(data[0].obj, json["included"].array[0].obj).toTrack() } else { null