myreadingmanga fix again (#552)
This commit is contained in:
parent
ab49ffef91
commit
5e861d3c4f
|
@ -5,8 +5,8 @@ ext {
|
|||
appName = 'Tachiyomi: MyReadingManga'
|
||||
pkgNameSuffix = 'all.myreadingmanga'
|
||||
extClass = '.MyReadingMangaFactory'
|
||||
extVersionCode = 8
|
||||
extVersionSuffix = 7
|
||||
extVersionCode = 9
|
||||
extVersionSuffix = 8
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -69,16 +69,18 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
|
|||
val manga = SManga.create()
|
||||
manga.setUrlWithoutDomain(titleElement.attr("href"))
|
||||
manga.title = cleanTitle(titleElement.text())
|
||||
manga.thumbnail_url =
|
||||
when {
|
||||
thumbnailElement.attr("data-src").endsWith(".jpg") -> getThumbnail(thumbnailElement.attr("data-src"))
|
||||
thumbnailElement.attr("src").endsWith(".jpg") -> getThumbnail(thumbnailElement.attr("src"))
|
||||
else -> getThumbnail(thumbnailElement.attr("data-lazy-src"))
|
||||
}
|
||||
|
||||
manga.thumbnail_url = getThumbnail(getImage(thumbnailElement))
|
||||
return manga
|
||||
}
|
||||
|
||||
private fun getImage(element: Element): String {
|
||||
return when {
|
||||
element.attr("data-src").endsWith(".jpg") -> element.attr("data-src")
|
||||
element.attr("src").endsWith(".jpg") -> element.attr("src")
|
||||
else -> element.attr("data-lazy-src")
|
||||
}
|
||||
}
|
||||
|
||||
//removes resizing
|
||||
private fun getThumbnail(thumbnailUrl: String) = thumbnailUrl.substringBeforeLast("-") + "." + thumbnailUrl.substringAfterLast(".")
|
||||
|
||||
|
@ -136,7 +138,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
|
|||
override fun searchMangaNextPageSelector() = null
|
||||
|
||||
|
||||
|
||||
override fun chapterFromElement(element: Element) = throw Exception("Not used")
|
||||
|
||||
override fun pageListParse(response: Response): List<Page> {
|
||||
|
@ -144,7 +145,7 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
|
|||
val pages = mutableListOf<Page>()
|
||||
val elements = body.select("div.separator > img")
|
||||
|
||||
(0 until elements.size).mapTo(pages) { Page(it, "", elements[it].attr("data-src")) }
|
||||
(0 until elements.size).mapTo(pages) { Page(it, "", getImage(elements[it])) }
|
||||
|
||||
return pages
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue