Exclude novels from Kitsu results

This commit is contained in:
len 2016-12-23 16:58:36 +01:00
parent d09eca7833
commit ea6fed6ecf
2 changed files with 4 additions and 1 deletions

View File

@ -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() }
}
}

View File

@ -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 {