Skip to content

Commit

Permalink
Remove official, move alt title, change unofficial
Browse files Browse the repository at this point in the history
  • Loading branch information
prem-k-r committed Feb 9, 2025
1 parent 07fb2a1 commit 7726833
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/en/weebcentral/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Weeb Central'
extClass = '.WeebCentral'
extVersionCode = 10
extVersionCode = 11
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,21 @@ class WeebCentral : ParsedHttpSource() {
author = select("ul > li:has(strong:contains(Author)) > span > a").joinToString { it.text() }
genre = select("ul > li:has(strong:contains(Tag),strong:contains(Type)) a").joinToString { it.text() }
status = selectFirst("ul > li:has(strong:contains(Status)) > a").parseStatus()

if (selectFirst("ul > li > strong:contains(Official Translation) + a:contains(Yes)") != null) {
descBuilder.appendLine("Official Translation")
descBuilder.appendLine()
}
}

with(document.select("section[x-data] > section")[1]) {
title = selectFirst("h1")!!.text()

val alternateTitles = select("li:has(strong:contains(Associated Name)) li")
if (alternateTitles.size > 0) {
descBuilder.appendLine("Associated Name(s):")
alternateTitles.forEach { descBuilder.appendLine(it.text()) }
descBuilder.appendLine()
}

descBuilder.append(
selectFirst("li:has(strong:contains(Description)) > p")?.text()
?.replace("NOTE: ", "\n\nNOTE: "),
)

val alternateTitles = select("li:has(strong:contains(Associated Name)) li")
if (alternateTitles.size > 0) {
descBuilder.append("\n\nAssociated Name(s):")
alternateTitles.forEach { descBuilder.append("\n").append(it.text()) }
}
}

description = descBuilder.toString()
Expand Down Expand Up @@ -163,7 +157,7 @@ class WeebCentral : ParsedHttpSource() {
element.selectFirst("svg")?.attr("stroke")?.also { stroke ->
scanlator = when (stroke) {
"#d8b4fe" -> "Official"
"#4C4D54" -> "Unofficial"
"#4C4D54" -> "Unknown"
else -> null
}
}
Expand Down

0 comments on commit 7726833

Please sign in to comment.