Readmanga and Mintmanga: Status fix (#2703)

This commit is contained in:
Kirill 2020-04-19 04:13:20 +05:00 committed by GitHub
parent d4579b7e77
commit 8f5ddea8a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 34 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga'
extVersionCode = 20
extVersionCode = 21
libVersion = '1.2'
}

View File

@ -96,26 +96,16 @@ class Mintmanga : ParsedHttpSource() {
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement)
manga.status = parseStatus(infoElement.html())
manga.thumbnail_url = infoElement.select("img").attr("data-full")
return manga
}
private fun parseStatus(element: Element): Int {
val hiddenWarningMessage = element.select("span.hide > h3").first()
val html = element.html()
return if (hiddenWarningMessage != null) {
when {
html.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
html.contains("<h1 class=\"names\"> Сингл") || html.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
} else {
when {
html.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED
else -> SManga.UNKNOWN
}
}
private fun parseStatus(element: String): Int = when {
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
else -> SManga.UNKNOWN
}
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga'
extVersionCode = 17
extVersionCode = 18
libVersion = '1.2'
}

View File

@ -96,26 +96,16 @@ class Readmanga : ParsedHttpSource() {
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement)
manga.status = parseStatus(infoElement.html())
manga.thumbnail_url = infoElement.select("img").attr("data-full")
return manga
}
private fun parseStatus(element: Element): Int {
val hiddenWarningMessage = element.select("span.hide > h3").first()
val html = element.html()
return if (hiddenWarningMessage != null) {
when {
html.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
html.contains("<h1 class=\"names\"> Сингл") || html.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
} else {
when {
html.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED
else -> SManga.UNKNOWN
}
}
private fun parseStatus(element: String): Int = when {
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
else -> SManga.UNKNOWN
}
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {