mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	fix bangumi tracker crash in searching english manga title (#2452)	eb5382e0	mutsumi <4182301+mutsumi63@users.noreply.github.com>	Jan 6, 2020 at 20:02
				
					
				
			This commit is contained in:
		| @@ -84,10 +84,13 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept | ||||
|     return authClient.newCall(request) | ||||
|       .asObservableSuccess() | ||||
|       .map { netResponse -> | ||||
|         val responseBody = netResponse.body()?.string().orEmpty() | ||||
|         var responseBody = netResponse.body()?.string().orEmpty() | ||||
|         if (responseBody.isEmpty()) { | ||||
|           throw Exception("Null Response") | ||||
|         } | ||||
|         if(responseBody.contains("\"code\":404")){ | ||||
|           responseBody = "{\"results\":0,\"list\":[]}" | ||||
|         } | ||||
|         val response = parser.parse(responseBody).obj["list"]?.array | ||||
|         response?.filter { it.obj["type"].asInt == 1 }?.map { jsonToSearch(it.obj) } | ||||
|       } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user