Fix Alternative name handling null (#8544)
* Fix Alternative name handling null fix Alternative name causing issue when manga description is null filter/dont add alternative name if only contains spaces by using isBlank() * fix typo
This commit is contained in:
parent
24b583ac6a
commit
f4a3bdd739
|
@ -84,10 +84,10 @@ class MidnightMessScans : Madara("Midnight Mess Scans", "https://midnightmess.or
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it.notUpdating()) {
|
||||
manga.description += when {
|
||||
manga.description.isNullOrEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it.notUpdating()) {
|
||||
manga.description = when {
|
||||
manga.description.isNullOrBlank() -> altName + it
|
||||
else -> manga.description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class MidnightMessScans : Madara("Midnight Mess Scans", "https://midnightmess.or
|
|||
|
||||
return manga
|
||||
}
|
||||
|
||||
|
||||
override fun getGenreList() = listOf(
|
||||
Genre("Bilibili", "bilibili"),
|
||||
Genre("Complete", "complete"),
|
||||
|
|
|
@ -50,10 +50,10 @@ class ReaperScansFR : WPMangaReader("ReaperScans.fr (GS)", "https://reaperscans.
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,10 +126,10 @@ class KomikCast : WPMangaStream("Komik Cast", "https://komikcast.com", "id") {
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it != "N/A" && it != "-") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it != "N/A" && it != "-") {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,10 @@ class WestManga : WPMangaStream("West Manga", "https://westmanga.info", "id") {
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it !="N/A" && it != "-") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it !="N/A" && it != "-") {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,10 +169,10 @@ abstract class FMReader(
|
|||
|
||||
// add alternative name to manga description
|
||||
infoElement.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it.contains("Updating", true).not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it.contains("Updating", true).not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ class FMReaderGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "FMReader"
|
||||
|
||||
override val baseVersionCode: Int = 5
|
||||
override val baseVersionCode: Int = 6
|
||||
|
||||
/** For future sources: when testing and popularMangaRequest() returns a Jsoup error instead of results
|
||||
* most likely the fix is to override popularMangaNextPageSelector() */
|
||||
|
|
|
@ -370,10 +370,10 @@ abstract class Madara(
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it.notUpdating()) {
|
||||
manga.description += when {
|
||||
manga.description.isNullOrEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it.notUpdating()) {
|
||||
manga.description = when {
|
||||
manga.description.isNullOrBlank() -> altName + it
|
||||
else -> manga.description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "Madara"
|
||||
|
||||
override val baseVersionCode: Int = 8
|
||||
override val baseVersionCode: Int = 9
|
||||
|
||||
override val sources = listOf(
|
||||
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 6),
|
||||
|
|
|
@ -157,10 +157,10 @@ abstract class MangaBox(
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class MangaBoxGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "MangaBox"
|
||||
|
||||
override val baseVersionCode: Int = 3
|
||||
override val baseVersionCode: Int = 4
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Mangakakalot", "https://mangakakalot.com", "en", overrideVersionCode = 3),
|
||||
|
|
|
@ -232,10 +232,10 @@ abstract class NepNep(
|
|||
// add alternative name to manga description
|
||||
val altName = "Alternative Name: "
|
||||
info.select("li.list-group-item:has(span:contains(Alter))").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it != "N/A") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it != "N/A") {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -392,4 +392,4 @@ abstract class NepNep(
|
|||
Genre("Yaoi"),
|
||||
Genre("Yuri")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class NepNepGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "NepNep"
|
||||
|
||||
override val baseVersionCode: Int = 5
|
||||
override val baseVersionCode: Int = 6
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("MangaSee", "https://mangasee123.com", "en", overrideVersionCode = 20),
|
||||
|
|
|
@ -182,10 +182,10 @@ abstract class WPMangaReader(
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "WPMangaReader"
|
||||
|
||||
override val baseVersionCode: Int = 8
|
||||
override val baseVersionCode: Int = 9
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Anitation Arts", "https://anitationarts.org", "en", overrideVersionCode = 1),
|
||||
|
|
|
@ -177,10 +177,10 @@ abstract class WPMangaStream(
|
|||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it != "N/A" && it != "-") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not() && it != "N/A" && it != "-") {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "WPMangaStream"
|
||||
|
||||
override val baseVersionCode: Int = 9
|
||||
override val baseVersionCode: Int = 10
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Asura Scans", "https://www.asurascans.com", "en", overrideVersionCode = 5),
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Mangahub'
|
||||
pkgNameSuffix = 'en.mangahub'
|
||||
extClass = '.Mangahub'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -89,11 +89,12 @@ class Mangahub : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
// add alternative name to manga description
|
||||
val altName = "Alternative Name: "
|
||||
document.select("h1 small").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
manga.description += when {
|
||||
manga.description!!.isEmpty() -> "Alternative Name: $it"
|
||||
else -> "\n\nAlternative Name: $it"
|
||||
if (it.isBlank().not()) {
|
||||
manga.description = when {
|
||||
manga.description.isNullOrBlank() -> altName + it
|
||||
else -> manga.description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'MangaPark'
|
||||
pkgNameSuffix = 'en.mangapark'
|
||||
extClass = '.MangaPark'
|
||||
extVersionCode = 21
|
||||
extVersionCode = 22
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -121,10 +121,10 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() {
|
|||
// add alternative name to manga description
|
||||
val altName = "Alternative Name: "
|
||||
document.select(".attr > tbody > tr:contains(Alter) td").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Maid - Manga'
|
||||
pkgNameSuffix = 'id.maidmanga'
|
||||
extClass = '.MaidManga'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -119,10 +119,10 @@ class MaidManga : ParsedHttpSource() {
|
|||
// add alternative name to manga description
|
||||
val altName = "Alternative Name: "
|
||||
document.select(".series-title span").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
if (it.isBlank().not()) {
|
||||
description = when {
|
||||
description.isNullOrBlank() -> altName + it
|
||||
else -> description + "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue