[Ổ Truyện] Small fixes (#2027)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,6 +27,7 @@
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
.idea/.name
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
|
||||
2
.idea/.gitignore
generated
vendored
2
.idea/.gitignore
generated
vendored
@@ -3,3 +3,5 @@
|
||||
/workspace.xml
|
||||
# GitHub Copilot persisted chat sessions
|
||||
/copilot/chatSessions
|
||||
|
||||
.name
|
||||
|
||||
@@ -32,9 +32,7 @@ import java.text.SimpleDateFormat
|
||||
import java.util.EnumSet
|
||||
import java.util.Locale
|
||||
import java.util.TimeZone
|
||||
import org.koitharu.kotatsu.parsers.Broken
|
||||
|
||||
@Broken
|
||||
@MangaSourceParser("OTRUYEN", "Ổ Truyện", "vi")
|
||||
internal class OTruyenParser(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.OTRUYEN, 24) {
|
||||
@@ -132,16 +130,10 @@ internal class OTruyenParser(context: MangaLoaderContext) :
|
||||
url = jo.getString("slug"),
|
||||
publicUrl = "https://otruyen.cc/truyen-tranh/${jo.getString("slug")}",
|
||||
title = jo.getString("name"),
|
||||
altTitles = jo.getJSONArray("origin_name").mapJSONToSet { it.toString() },
|
||||
altTitles = emptySet(),
|
||||
coverUrl = "https://img.otruyenapi.com/uploads/comics/${jo.getString("thumb_url")}",
|
||||
authors = jo.getJSONArray("author").mapJSONToSet { it.toString() },
|
||||
tags = jo.getJSONArray("category").mapJSONToSet { category ->
|
||||
MangaTag(
|
||||
title = category.getString("name"),
|
||||
key = category.getString("slug"),
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
authors = emptySet(),
|
||||
tags = emptySet(),
|
||||
state = when (jo.getString("status")) {
|
||||
"ongoing" -> MangaState.ONGOING
|
||||
"coming_soon" -> MangaState.UPCOMING
|
||||
@@ -184,8 +176,12 @@ internal class OTruyenParser(context: MangaLoaderContext) :
|
||||
}
|
||||
|
||||
return manga.copy(
|
||||
altTitles = item.getJSONArray("origin_name").mapJSONToSet { it.toString() },
|
||||
authors = item.getJSONArray("author").mapJSONToSet { it.toString() },
|
||||
altTitles = item.getJSONArray("origin_name").let { jsonArray ->
|
||||
(0 until jsonArray.length()).mapTo(mutableSetOf()) { jsonArray.getString(it) }
|
||||
},
|
||||
authors = item.getJSONArray("author").let { jsonArray ->
|
||||
(0 until jsonArray.length()).mapTo(mutableSetOf()) { jsonArray.getString(it) }
|
||||
},
|
||||
tags = item.optJSONArray("category").mapJSONToSet { jo ->
|
||||
MangaTag(
|
||||
title = jo.optString("name"),
|
||||
|
||||
Reference in New Issue
Block a user