mangadex another double fix (#332)
This commit is contained in:
parent
5a5e11502c
commit
55eae75862
|
@ -5,8 +5,8 @@ ext {
|
||||||
appName = 'Tachiyomi: MangaDex'
|
appName = 'Tachiyomi: MangaDex'
|
||||||
pkgNameSuffix = "all.mangadex"
|
pkgNameSuffix = "all.mangadex"
|
||||||
extClass = '.MangadexFactory'
|
extClass = '.MangadexFactory'
|
||||||
extVersionCode = 24
|
extVersionCode = 25
|
||||||
extVersionSuffix = 24
|
extVersionSuffix = 25
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,8 +224,8 @@ open class Mangadex(override val lang: String, private val internalLang: String,
|
||||||
manga.description = cleanString(mangaJson.get("description").string)
|
manga.description = cleanString(mangaJson.get("description").string)
|
||||||
manga.author = mangaJson.get("author").string
|
manga.author = mangaJson.get("author").string
|
||||||
manga.artist = mangaJson.get("artist").string
|
manga.artist = mangaJson.get("artist").string
|
||||||
val finalChapterNumber = mangaJson.get("last_chapter").int
|
val finalChapterNumber = getFinalChapter(mangaJson)
|
||||||
if (finalChapterNumber != 0) {
|
if (finalChapterNumber != 0.00) {
|
||||||
manga.status = SManga.COMPLETED
|
manga.status = SManga.COMPLETED
|
||||||
} else {
|
} else {
|
||||||
manga.status = parseStatus(mangaJson.get("status").int)
|
manga.status = parseStatus(mangaJson.get("status").int)
|
||||||
|
@ -260,13 +260,23 @@ open class Mangadex(override val lang: String, private val internalLang: String,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getFinalChapter(jsonObj: JsonObject): Double {
|
||||||
|
var finalChapterNumber = 0.00
|
||||||
|
|
||||||
|
if (jsonObj.get("last_chapter").string.isNotBlank()) {
|
||||||
|
finalChapterNumber = jsonObj.get("last_chapter").double
|
||||||
|
}
|
||||||
|
return finalChapterNumber
|
||||||
|
}
|
||||||
|
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
val now = Date().time
|
val now = Date().time
|
||||||
var jsonData = response.body()!!.string()
|
var jsonData = response.body()!!.string()
|
||||||
val json = JsonParser().parse(jsonData).asJsonObject
|
val json = JsonParser().parse(jsonData).asJsonObject
|
||||||
val mangaJson = json.getAsJsonObject("manga")
|
val mangaJson = json.getAsJsonObject("manga")
|
||||||
|
|
||||||
val finalChapterNumber = mangaJson.get("last_chapter").double
|
|
||||||
|
var finalChapterNumber = getFinalChapter(mangaJson)
|
||||||
val chapterJson = json.getAsJsonObject("chapter")
|
val chapterJson = json.getAsJsonObject("chapter")
|
||||||
val chapters = mutableListOf<SChapter>()
|
val chapters = mutableListOf<SChapter>()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue