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 {
put(
"value",
JsonPrimitive ("+$lusLang${languageIds["value"]!!.jsonPrimitive.content}")
JsonPrimitive("+$lusLang${languageIds["value"]!!.jsonPrimitive.content}")
)
}
)
@ -210,7 +210,7 @@ abstract class Luscious(
private fun buildAlbumInfoRequestInput(id: String): JsonObject {
return buildJsonObject {
put("id", id)
put("id", id)
}
}
@ -268,7 +268,7 @@ abstract class Luscious(
val chapter = SChapter.create()
val url = when (getResolutionPref()) {
"-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 {
url.startsWith("//") -> chapter.url = "https:$url"
@ -300,10 +300,12 @@ abstract class Luscious(
return buildJsonObject {
putJsonObject("input") {
putJsonArray("filters") {
add(buildJsonObject {
put("name", "album_id")
put("value", id)
})
add(
buildJsonObject {
put("name", "album_id")
put("value", id)
}
)
}
put("display", getSortPref())
put("page", page)
@ -338,7 +340,7 @@ abstract class Luscious(
val index = it.jsonObject["position"]!!.jsonPrimitive.int
val url = when (getResolutionPref()) {
"-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 {
url.startsWith("//") -> pages.add(Page(index, "https:$url", "https:$url"))
@ -387,7 +389,7 @@ abstract class Luscious(
}
when (getResolutionPref()) {
"-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 baseVersionCode: Int = 13
override val baseVersionCode: Int = 14
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),

View File

@ -511,7 +511,7 @@ abstract class Madara(
// Added "title" alternative
chapter.date_upload = select("img").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) }
?: select("span a").firstOrNull()?.attr("title")?.let { parseRelativeDate(it) }
?: parseChapterDate(select("span.chapter-release-date i").firstOrNull()?.text())
?: parseChapterDate(select("span.chapter-release-date i").firstOrNull()?.text())
}
return chapter