diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt index d4e74446..69242e70 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt @@ -182,15 +182,13 @@ internal class ComickFunParser(context: MangaLoaderContext) : val alt = comic.getJSONArray("md_titles").asTypedList().mapNotNullToSet { it.getStringOrNull("title") } - val author = jo.getJSONArray("artists").optJSONObject(0)?.getStringOrNull("name") + val authors = jo.getJSONArray("artists").mapJSONNotNullToSet { it.getStringOrNull("name") } return manga.copy( altTitles = alt, - contentRating = if (jo.getBooleanOrDefault("matureContent", false) - || comic.getBooleanOrDefault("hentai", false) - ) { - ContentRating.ADULT - } else { - ContentRating.SAFE + contentRating = when { + comic.getBooleanOrDefault("hentai", false) -> ContentRating.ADULT + jo.getBooleanOrDefault("matureContent", false) -> ContentRating.SUGGESTIVE + else -> ContentRating.SAFE }, description = comic.getStringOrNull("parsed") ?: comic.getStringOrNull("desc"), tags = manga.tags + comic.getJSONArray("md_comic_md_genres").mapJSONToSet { @@ -201,7 +199,7 @@ internal class ComickFunParser(context: MangaLoaderContext) : source = source, ) }, - authors = setOfNotNull(author), + authors = authors, chapters = getChapters(comic.getString("hid")), ) } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/pt/SussyScan.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/pt/SussyScan.kt index 9c08570c..d5410d7b 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/pt/SussyScan.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/pt/SussyScan.kt @@ -1,10 +1,12 @@ package org.koitharu.kotatsu.parsers.site.madara.pt +import org.koitharu.kotatsu.parsers.Broken import org.koitharu.kotatsu.parsers.MangaLoaderContext import org.koitharu.kotatsu.parsers.MangaSourceParser import org.koitharu.kotatsu.parsers.model.MangaParserSource import org.koitharu.kotatsu.parsers.site.madara.MadaraParser +@Broken @MangaSourceParser("SUSSYSCAN", "SussyScan", "pt") internal class SussyScan(context: MangaLoaderContext) : MadaraParser(context, MangaParserSource.SUSSYSCAN, "oldi.sussytoons.site") diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/util/json/JsonExt.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/util/json/JsonExt.kt index 690925b5..b95a7ddc 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/util/json/JsonExt.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/util/json/JsonExt.kt @@ -48,7 +48,7 @@ public inline fun JSONArray.mapJSON(block: (JSONObject) -> T): List { return mapJSONTo(ArrayList(length()), block) } -public inline fun JSONArray.mapJSONNotNull(block: (JSONObject) -> T?): List { +public inline fun JSONArray.mapJSONNotNull(block: (JSONObject) -> T?): List { return mapJSONNotNullTo(ArrayList(length()), block) } @@ -56,6 +56,10 @@ public inline fun JSONArray.mapJSONToSet(mapper: (JSONObject) -> T): Set return mapJSONTo(ArraySet(length()), mapper) } +public inline fun JSONArray.mapJSONNotNullToSet(mapper: (JSONObject) -> T?): Set { + return mapJSONNotNullTo(ArraySet(length()), mapper) +} + public fun JSONArray.mapJSONIndexed(block: (Int, JSONObject) -> T): List { val len = length() val result = ArrayList(len)