Update Remanga.kt (#7218)

* Update Remanga.kt

Fix crash with 500 on remanga

* Remanga 26 version
This commit is contained in:
Pavka 2021-05-25 15:21:51 +03:00 committed by GitHub
parent 964ad72e2c
commit 8f8c1ef90e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Remanga'
pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga'
extVersionCode = 25
extVersionCode = 26
libVersion = '1.2'
}

View File

@ -105,7 +105,7 @@ class Remanga : ConfigurableSource, HttpSource() {
jsonObject.put("password", password)
val body = jsonObject.toString().toRequestBody(MEDIA_TYPE)
val response = chain.proceed(POST("$baseUrl/api/users/login/", headers, body))
if (response.code == 400) {
if (response.code >= 400) {
throw Exception("Failed to login")
}
val user = gson.fromJson<SeriesWrapperDto<UserDto>>(response.body?.charStream()!!)