Fix lateinit error in some MangaThemesia sources. (#13235)

This commit is contained in:
Alessandro Jean 2022-08-27 17:53:07 -03:00 committed by GitHub
parent b3220a05d1
commit 756e27d4a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -18,5 +18,9 @@ class MangasChan : MangaThemesia(
.rateLimit(1, 2, TimeUnit.SECONDS) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .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"
} }

View File

@ -142,7 +142,7 @@ abstract class MangaThemesia(
override fun searchMangaNextPageSelector() = "div.pagination .next, div.hpage .r" override fun searchMangaNextPageSelector() = "div.pagination .next, div.hpage .r"
// Manga details // 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 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 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)" 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() protected open fun Elements.imgAttr(): String = this.first().imgAttr()
// Unused // Unused

View File

@ -10,7 +10,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
override val themeClass = "MangaThemesia" override val themeClass = "MangaThemesia"
override val baseVersionCode: Int = 18 override val baseVersionCode: Int = 19
override val sources = listOf( override val sources = listOf(
MultiLang("Asura Scans", "https://www.asurascans.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 16), MultiLang("Asura Scans", "https://www.asurascans.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 16),