WeComics: Update logic and error message for paid chapters. (#7598)
This commit is contained in:
parent
fcb929f4e6
commit
675d44272a
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'WeComics'
|
extName = 'WeComics'
|
||||||
pkgNameSuffix = 'en.wecomics'
|
pkgNameSuffix = 'en.wecomics'
|
||||||
extClass = '.WeComics'
|
extClass = '.WeComics'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,10 +163,10 @@ class WeComics : HttpSource() {
|
||||||
// Error code 401 when not logged in and data is empty when logged in,
|
// Error code 401 when not logged in and data is empty when logged in,
|
||||||
// assuming this is populated after a purchase
|
// assuming this is populated after a purchase
|
||||||
val jsonObject = gson.fromJson<JsonObject>(response.body!!.string())
|
val jsonObject = gson.fromJson<JsonObject>(response.body!!.string())
|
||||||
if (jsonObject["error_code"].asInt != 2 &&
|
if (jsonObject["error_code"].asInt == 401 ||
|
||||||
jsonObject["data"]["chapter"]["data"].asString != ""
|
jsonObject["data"]["chapter"]["data"].asString == ""
|
||||||
)
|
)
|
||||||
throw Exception("Chapter is currently not available.")
|
throw Exception("Chapter is currently not available.\nLog in through WebView if purchased.")
|
||||||
|
|
||||||
val data = jsonObject["data"]["chapter"]["data"].asString
|
val data = jsonObject["data"]["chapter"]["data"].asString
|
||||||
val key = data.substring(0, 8)
|
val key = data.substring(0, 8)
|
||||||
|
|
Loading…
Reference in New Issue