Truncate MAL search queries to first 64 characters (closes #6314)
Is it worth telling the user? ¯\_(ツ)_/¯ (cherry picked from commit 58c2f221203a63b684bec29879b5714748d19962)
This commit is contained in:
parent
638e569410
commit
8e0ca68af7
1 changed files with 2 additions and 1 deletions
|
|
@ -62,7 +62,8 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI
|
|||
suspend fun search(query: String): List<TrackSearch> {
|
||||
return withIOContext {
|
||||
val url = "$baseApiUrl/manga".toUri().buildUpon()
|
||||
.appendQueryParameter("q", query)
|
||||
// MAL API throws a 400 when the query is over 64 characters...
|
||||
.appendQueryParameter("q", query.take(64))
|
||||
.appendQueryParameter("nsfw", "true")
|
||||
.build()
|
||||
authClient.newCall(GET(url.toString()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue