Fix mangas page and status (#853)

Fix mangas page and status
This commit is contained in:
Pavka 2019-02-28 11:53:29 +03:00 committed by Carlos
parent 268115a52d
commit ce5d8f84e0
2 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mangaonlinebiz'
pkgNameSuffix = 'ru.mangaonlinebiz'
extClass = '.MangaOnlineBiz'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -76,13 +76,19 @@ class MangaOnlineBiz : ParsedHttpSource() {
manga.genre = infoElement.select("a.label").joinToString { it.text() }
manga.description = infoElement.select(".description").text()
manga.thumbnail_url = infoElement.select("img").first().attr("src")
if (infoElement.text().contains("Перевод: закончен")) {
manga.status = SManga.COMPLETED
} else if (infoElement.text().contains("Перевод: продолжается")) {
manga.status = SManga.ONGOING
}
return manga
}
override fun chapterListParse(response: Response): List<SChapter> {
val html = response.body()!!.string()
val jsonData = html.split("App.Collection.MangaChapter(").last().split(");").first()
val jsonData = html.split("App.Collection.MangaChapter(").last().split("]);").first() + "]"
val mangaName = html.split("mangaName: '").last().split("' });").first()
val json = JsonParser().parse(jsonData).asJsonArray
val chapterList = mutableListOf<SChapter>()
@ -105,7 +111,7 @@ class MangaOnlineBiz : ParsedHttpSource() {
override fun pageListParse(response: Response): List<Page> {
val html = response.body()!!.string()
val jsonData = html.split("new App.Router.Chapter(").last().split(");").first()
val jsonData = html.split("new App.Router.Chapter(").last().split("});").first() + "}"
val json = JsonParser().parse(jsonData).asJsonObject
val cdnUrl = json.get("srcBaseUrl").string
val pages = json.get("pages").asJsonObject