Update Mangachan address and fix loading covers after update (#347)

This commit is contained in:
Taumer 2016-06-11 16:59:04 +03:00 committed by Bram van de Kerkhof
parent e79d536f33
commit 4de8b6e9a8

View File

@ -17,7 +17,7 @@ class Mangachan(context: Context, override val id: Int) : ParsedOnlineSource(con
override val name = "Mangachan" override val name = "Mangachan"
override val baseUrl = "http://mangachan.ru" override val baseUrl = "http://mangachan.me"
override val lang: Language get() = RU override val lang: Language get() = RU
@ -32,9 +32,6 @@ class Mangachan(context: Context, override val id: Int) : ParsedOnlineSource(con
manga.setUrl(it.attr("href")) manga.setUrl(it.attr("href"))
manga.title = it.text() manga.title = it.text()
} }
element.select("img").first().let {
manga.thumbnail_url = baseUrl + it.attr("src")
}
} }
override fun popularMangaNextPageSelector() = "a:contains(Вперед)" override fun popularMangaNextPageSelector() = "a:contains(Вперед)"
@ -50,11 +47,13 @@ class Mangachan(context: Context, override val id: Int) : ParsedOnlineSource(con
override fun mangaDetailsParse(document: Document, manga: Manga) { override fun mangaDetailsParse(document: Document, manga: Manga) {
val infoElement = document.select("table.mangatitle").first() val infoElement = document.select("table.mangatitle").first()
val descElement = document.select("div#description").first() val descElement = document.select("div#description").first()
val imgElement = document.select("img#cover").first()
manga.author = infoElement.select("tr:eq(2) > td:eq(1)").text() manga.author = infoElement.select("tr:eq(2) > td:eq(1)").text()
manga.genre = infoElement.select("tr:eq(5) > td:eq(1)").text() manga.genre = infoElement.select("tr:eq(5) > td:eq(1)").text()
manga.status = parseStatus(infoElement.select("tr:eq(4) > td:eq(1)").text()) manga.status = parseStatus(infoElement.select("tr:eq(4) > td:eq(1)").text())
manga.description = descElement.textNodes().first().text() manga.description = descElement.textNodes().first().text()
manga.thumbnail_url = baseUrl + imgElement.attr("src")
} }
private fun parseStatus(element: String): Int { private fun parseStatus(element: String): Int {