Madara: fix lateinit not initialized for some source (#14228)

* Madara: fix lateinit not initialized

- check if initialized

* Update multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
This commit is contained in:
Luqman 2022-11-14 02:44:11 +07:00 committed by GitHub
parent 61b063a7c0
commit 0a9555c292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -665,6 +665,12 @@ abstract class Madara(
.toMutableSet() .toMutableSet()
// add tag(s) to genre // add tag(s) to genre
val mangaTitle = try {
manga.title
} catch (_: UninitializedPropertyAccessException) {
"not initialized"
}
if (mangaDetailsSelectorTag.isNotEmpty()) { if (mangaDetailsSelectorTag.isNotEmpty()) {
select(mangaDetailsSelectorTag).forEach { element -> select(mangaDetailsSelectorTag).forEach { element ->
if (genres.contains(element.text()).not() && if (genres.contains(element.text()).not() &&
@ -672,7 +678,7 @@ abstract class Madara(
element.text().contains("read", true).not() && element.text().contains("read", true).not() &&
element.text().contains(name, true).not() && element.text().contains(name, true).not() &&
element.text().contains(name.replace(" ", ""), true).not() && element.text().contains(name.replace(" ", ""), true).not() &&
element.text().contains(manga.title, true).not() && element.text().contains(mangaTitle, true).not() &&
element.text().contains(altName, true).not() element.text().contains(altName, true).not()
) { ) {
genres.add(element.text().lowercase(Locale.ROOT)) genres.add(element.text().lowercase(Locale.ROOT))

View File

@ -10,7 +10,7 @@ class MadaraGenerator : ThemeSourceGenerator {
override val themeClass = "Madara" override val themeClass = "Madara"
override val baseVersionCode: Int = 25 override val baseVersionCode: Int = 26
override val sources = listOf( override val sources = listOf(
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 13), MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 13),