Fix Gson conversion mistake (fixes #10118)

I wonder if it'll only be 1.
This commit is contained in:
arkon 2021-12-15 19:11:40 -05:00
parent b02fef76c5
commit 3406d5bf04
3 changed files with 13 additions and 11 deletions

View File

@ -128,7 +128,7 @@ abstract class Luscious(
languageIds.toMutableMap().apply { languageIds.toMutableMap().apply {
put( put(
"value", "value",
JsonPrimitive ("+$lusLang${languageIds["value"]!!.jsonPrimitive.content}") JsonPrimitive("+$lusLang${languageIds["value"]!!.jsonPrimitive.content}")
) )
} }
) )
@ -268,7 +268,7 @@ abstract class Luscious(
val chapter = SChapter.create() val chapter = SChapter.create()
val url = when (getResolutionPref()) { val url = when (getResolutionPref()) {
"-1" -> it.jsonObject["url_to_original"]!!.jsonPrimitive.content "-1" -> it.jsonObject["url_to_original"]!!.jsonPrimitive.content
else -> it.jsonObject["thumbnails"]!!.jsonObject[getResolutionPref()?.toInt()!!]!!.jsonObject["url"]!!.jsonPrimitive.content else -> it.jsonObject["thumbnails"]!!.jsonArray[getResolutionPref()?.toInt()!!].jsonObject["url"]!!.jsonPrimitive.content
} }
when { when {
url.startsWith("//") -> chapter.url = "https:$url" url.startsWith("//") -> chapter.url = "https:$url"
@ -300,10 +300,12 @@ abstract class Luscious(
return buildJsonObject { return buildJsonObject {
putJsonObject("input") { putJsonObject("input") {
putJsonArray("filters") { putJsonArray("filters") {
add(buildJsonObject { add(
buildJsonObject {
put("name", "album_id") put("name", "album_id")
put("value", id) put("value", id)
}) }
)
} }
put("display", getSortPref()) put("display", getSortPref())
put("page", page) put("page", page)
@ -338,7 +340,7 @@ abstract class Luscious(
val index = it.jsonObject["position"]!!.jsonPrimitive.int val index = it.jsonObject["position"]!!.jsonPrimitive.int
val url = when (getResolutionPref()) { val url = when (getResolutionPref()) {
"-1" -> it.jsonObject["url_to_original"]!!.jsonPrimitive.content "-1" -> it.jsonObject["url_to_original"]!!.jsonPrimitive.content
else -> it.jsonObject["thumbnails"]!!.jsonObject[getResolutionPref()?.toInt()!!]!!.jsonObject["url"]!!.jsonPrimitive.content else -> it.jsonObject["thumbnails"]!!.jsonArray[getResolutionPref()?.toInt()!!].jsonObject["url"]!!.jsonPrimitive.content
} }
when { when {
url.startsWith("//") -> pages.add(Page(index, "https:$url", "https:$url")) url.startsWith("//") -> pages.add(Page(index, "https:$url", "https:$url"))
@ -387,7 +389,7 @@ abstract class Luscious(
} }
when (getResolutionPref()) { when (getResolutionPref()) {
"-1" -> data["items"]!!.jsonArray[page.index % 50].jsonObject["url_to_original"]!!.jsonPrimitive.content "-1" -> data["items"]!!.jsonArray[page.index % 50].jsonObject["url_to_original"]!!.jsonPrimitive.content
else -> data["items"]!!.jsonArray[page.index % 50].jsonObject["thumbnails"]!!.jsonObject[getResolutionPref()?.toInt()!!]!!.jsonObject["url"]!!.jsonPrimitive.content else -> data["items"]!!.jsonArray[page.index % 50].jsonObject["thumbnails"]!!.jsonArray[getResolutionPref()?.toInt()!!].jsonObject["url"]!!.jsonPrimitive.content
} }
} }
} }

View File

@ -9,7 +9,7 @@ class LusciousGenerator : ThemeSourceGenerator {
override val themeClass = "Luscious" override val themeClass = "Luscious"
override val baseVersionCode: Int = 13 override val baseVersionCode: Int = 14
override val sources = listOf( override val sources = listOf(
MultiLang("Luscious", "https://www.luscious.net", listOf("en", "ja", "es", "it", "de", "fr", "zh", "ko", "other", "pt-BR", "th", "all"), isNsfw = true, className = "LusciousFactory", overrideVersionCode = 2), MultiLang("Luscious", "https://www.luscious.net", listOf("en", "ja", "es", "it", "de", "fr", "zh", "ko", "other", "pt-BR", "th", "all"), isNsfw = true, className = "LusciousFactory", overrideVersionCode = 2),