Browse Source

Exclude novels from Kitsu results

len 8 years ago
parent
commit
ea6fed6ecf

+ 3 - 1
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() }
                 }
     }
 

+ 1 - 0
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 {