From 756e27d4a83380531cfc6c4ce431b431ec144296 Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Sat, 27 Aug 2022 17:53:07 -0300 Subject: [PATCH] Fix lateinit error in some MangaThemesia sources. (#13235) --- .../overrides/mangathemesia/mangaschan/src/MangasChan.kt | 6 +++++- .../tachiyomi/multisrc/mangathemesia/MangaThemesia.kt | 9 +++++++-- .../multisrc/mangathemesia/MangaThemesiaGenerator.kt | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/multisrc/overrides/mangathemesia/mangaschan/src/MangasChan.kt b/multisrc/overrides/mangathemesia/mangaschan/src/MangasChan.kt index 18206471d..248247368 100644 --- a/multisrc/overrides/mangathemesia/mangaschan/src/MangasChan.kt +++ b/multisrc/overrides/mangathemesia/mangaschan/src/MangasChan.kt @@ -18,5 +18,9 @@ class MangasChan : MangaThemesia( .rateLimit(1, 2, TimeUnit.SECONDS) .build() - override val altNamePrefix = "Nome alternativo: " + override val altNamePrefix = "Nomes alternativos: " + + override val seriesArtistSelector = ".infotable tr:contains(Artista) td:last-child" + override val seriesAuthorSelector = ".infotable tr:contains(Autor) td:last-child" + override val seriesTypeSelector = ".infotable tr:contains(Tipo) td:last-child" } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt index 22cea2bee..df72998c0 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt @@ -142,7 +142,7 @@ abstract class MangaThemesia( override fun searchMangaNextPageSelector() = "div.pagination .next, div.hpage .r" // Manga details - open val seriesDetailsSelector = "div.bigcontent, div.animefull, div.main-info" + open val seriesDetailsSelector = "div.bigcontent, div.animefull, div.main-info, div.postbody" open val seriesTitleSelector = "h1.entry-title" open val seriesArtistSelector = ".infotable tr:contains(artist) td:last-child, .tsinfo .imptdt:contains(artist) i, .fmed b:contains(artist)+span, span:contains(artist)" open val seriesAuthorSelector = ".infotable tr:contains(author) td:last-child, .tsinfo .imptdt:contains(author) i, .fmed b:contains(author)+span, span:contains(author)" @@ -449,7 +449,12 @@ abstract class MangaThemesia( } } - protected open fun Element.imgAttr(): String = if (this.hasAttr("data-src")) this.attr("abs:data-src") else this.attr("abs:src") + protected open fun Element.imgAttr(): String = when { + hasAttr("data-lazy-src") -> attr("abs:data-lazy-src") + hasAttr("data-src") -> attr("abs:data-src") + else -> attr("abs:src") + } + protected open fun Elements.imgAttr(): String = this.first().imgAttr() // Unused diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt index a497cc9fc..c733f6322 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt @@ -10,7 +10,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { override val themeClass = "MangaThemesia" - override val baseVersionCode: Int = 18 + override val baseVersionCode: Int = 19 override val sources = listOf( MultiLang("Asura Scans", "https://www.asurascans.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 16),