From ae6d0529781e3ee598362f425c9cf4c7664f546c Mon Sep 17 00:00:00 2001 From: Ken Swenson Date: Sat, 27 Oct 2018 13:02:10 -0400 Subject: [PATCH] Update Anilist API search to return 50 results (#1657) * Update Anilist API search to return 50 results This will help alleviate not being able to find manga with generic names such as Monster * Add description to Anilist search dialogue --- .../eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index edb63931c4..74d02bbd44 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -90,7 +90,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { fun search(search: String): Observable> { val query = """ query Search(${'$'}query: String) { - Page (perPage: 25) { + Page (perPage: 50) { media(search: ${'$'}query, type: MANGA, format_not_in: [NOVEL]) { id title { @@ -102,6 +102,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { type status chapters + description startDate { year month @@ -160,6 +161,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { type status chapters + description startDate { year month @@ -245,7 +247,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { fun jsonToALManga(struct: JsonObject): ALManga{ return ALManga(struct["id"].asInt, struct["title"]["romaji"].asString, struct["coverImage"]["large"].asString, - null, struct["type"].asString, struct["status"].asString, + struct["description"].nullString.orEmpty(), struct["type"].asString, struct["status"].asString, struct["startDate"]["year"].nullString.orEmpty() + struct["startDate"]["month"].nullString.orEmpty() + struct["startDate"]["day"].nullString.orEmpty(), struct["chapters"].nullInt ?: 0) }