From ea6fed6ecf3fa41c25fc3f50a03670de556e110c Mon Sep 17 00:00:00 2001 From: len Date: Fri, 23 Dec 2016 16:58:36 +0100 Subject: [PATCH] Exclude novels from Kitsu results --- .../java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt | 4 +++- .../java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 45d962d469..12d6de5b45 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 @@ -79,7 +79,9 @@ class KitsuApi(private val client: OkHttpClient, interceptor: KitsuInterceptor) return rest.search(query) .map { json -> val data = json["data"].array - data.map { KitsuManga(it.obj).toTrack() } + data.map { KitsuManga(it.obj) } + .filter { it.type != "novel" } + .map { it.toTrack() } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt index 9c769225f9..2db2b7916d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt @@ -10,6 +10,7 @@ open class KitsuManga(obj: JsonObject) { val id by obj.byInt val canonicalTitle by obj["attributes"].byString val chapterCount = obj["attributes"].obj.get("chapterCount").nullInt + val type = obj["attributes"]["mangaType"].string @CallSuper open fun toTrack() = Track.create(TrackManager.KITSU).apply {